Apache Server configuration support - add slash to virtual dir

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > April 2004 > add slash to virtual dir





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author add slash to virtual dir
Josh

2004-04-29, 11:34 am

how can i add slash to virtual directory?
i put this rule in htaccess
RewriteRule ([^/]+)/$ /index.php?id=$1 [T=application/x-httpd-php,last]
and www.example.com/dir/ redirect to www.example.com/index.php?id=1
but www.example.com/dir return a 404

--
Josh
www.pixael.com
icq: 59204079
Josh

2004-04-30, 8:33 am

"Josh" <josh@pixael.com> ha scritto nel messaggio
news:c6r77f$ep2o8$1@ID-203386.news.uni-berlin.de...
> how can i add slash to virtual directory?
> i put this rule in htaccess
> RewriteRule ([^/]+)/$ /index.php?id=$1 [T=application/x-httpd-php,last]
> and www.example.com/dir/ redirect to www.example.com/index.php?id=1
> but www.example.com/dir return a 404


ok
RewriteRule ^([^.])$ /$1/ [R]
is this syntactically correct?

--
Josh
www.pixael.com
icq: 59204079

Justin Koivisto

2004-04-30, 9:33 am

Josh wrote:

> how can i add slash to virtual directory?
> i put this rule in htaccess
> RewriteRule ([^/]+)/$ /index.php?id=$1 [T=application/x-httpd-php,last]
> and www.example.com/dir/ redirect to www.example.com/index.php?id=1
> but www.example.com/dir return a 404
>


Try this:

RewriteRule ([^/]+)/?$ /index.php?id=$1 [T=application/x-httpd-php,last]
--------------------^

Note the "?" after the slash.

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for php related questions,
alt.php* groups are not recommended.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com