add slash to virtual dir

This is a discussion on add slash to virtual dir within the Apache Web Server forums, part of the Web Server and Related Forums category; how can i add slash to virtual directory? i put this rule in htaccess RewriteRule ([^/]+)/$ /index.php?id=$1 [T=...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-29-2004
Josh
 
Posts: n/a
Default add slash to virtual dir

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
  #2 (permalink)  
Old 04-30-2004
Josh
 
Posts: n/a
Default Re: add slash to virtual dir

"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

  #3 (permalink)  
Old 04-30-2004
Justin Koivisto
 
Posts: n/a
Default Re: add slash to virtual dir

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.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0