Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

add slash to virtual dir

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Directory security - stop files lists  
Author Message
josh1

External


Since: Jan 28, 2004
Posts: 19



(Msg. 1) Posted: Thu Apr 29, 2004 8:32 pm
Post subject: add slash to virtual dir
Archived from groups: alt>apache>configuration (more info?)

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

 >> Stay informed about: add slash to virtual dir 
Back to top
Login to vote
spam3

External


Since: Jul 01, 2003
Posts: 411



(Msg. 2) Posted: Fri Apr 30, 2004 4:20 pm
Post subject: Re: add slash to virtual dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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]
<font color=purple> > and <a style='text-decoration: underline;' href="http://www.example.com/dir/" target="_blank">www.example.com/dir/</a> redirect to <a style='text-decoration: underline;' href="http://www.example.com/index.php?id=1</font" target="_blank">www.example.com/index.php?id=1</font</a>>
 > but <a style='text-decoration: underline;' href="http://www.example.com/dir" target="_blank">www.example.com/dir</a> return a 404
 >

Try this:

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

Note the "?" after the slash.

--
Justin Koivisto - spam RemoveThis @koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: add slash to virtual dir 
Back to top
Login to vote
josh1

External


Since: Jan 28, 2004
Posts: 19



(Msg. 3) Posted: Fri Apr 30, 2004 4:58 pm
Post subject: Re: add slash to virtual dir [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Josh" <josh.RemoveThis@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]
<font color=purple> > and <a style='text-decoration: underline;' href="http://www.example.com/dir/" target="_blank">www.example.com/dir/</a> redirect to <a style='text-decoration: underline;' href="http://www.example.com/index.php?id=1</font" target="_blank">www.example.com/index.php?id=1</font</a>>
 > but <a style='text-decoration: underline;' href="http://www.example.com/dir" target="_blank">www.example.com/dir</a> return a 404

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

--
Josh
<a style='text-decoration: underline;' href="http://www.pixael.com" target="_blank">www.pixael.com</a>
icq: 59204079<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: add slash to virtual dir 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Ending slash in url - Rather common problem with ending slash at end of URL. I can't manage problems, that every time I go to http://hostname/folder I get error message - Can not display page (in IE), but when I add the / at end of url, ewerything is ok. Only way to get some....

!! Slash (/) problem !! with Apache - Hi, Experiencing a stupid problem with slash... On my Apache, my DocumentRoot is set to be /var/www/html. And I have a directory called /var/www/html/test1 If i type http://www.myserver.com/test1/ (with a '/' at the end), I can go to the correct page....

Removing an extra slash from redirected URLs - Hello all. I have just converted all of the pages on my website from .shtml to .php pages, but wish to use .htaccess to redirect requests for the .shtmls over to the .phps. I currently have this: RewriteEngine on RewriteBase / RewriteRule ..

Virtual Domain - Hi All In apache 2 how do you get Virtual Hosts working, I have got it running in Apache 1.4 but it wont work in Apache2 at all -- Regards CK www.networkingbasics.co.uk ****PLEASE USE ROT13 TO SEE MY EMAIL ADDRESS******

Virtual Host - Hej Virtual host - what's that mean? I have installed Apache-Tomcat inside intranet. I want that my Apache-Tomcat listen other host inside the intranet for example : gateway! Other users from world not see my server, becouse is inside the intranet. ..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]