Web Servers on Unix and Linux - Trailing slash problem with mod_rewrite (Apache 1.3.33 on FreeBSD)

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > December 2004 > Trailing slash problem with mod_rewrite (Apache 1.3.33 on FreeBSD)





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 Trailing slash problem with mod_rewrite (Apache 1.3.33 on FreeBSD)
mike.matz@gmail.com

2004-12-09, 8:48 pm

Hello everyone,

I'm having a problem with a mod_rewrite rule that seems to be causing
incorrectly typed URLs to not include a trailing slash (normally I
believe mod_dir automatically redirects from
http://server.com/dir1/dir2 to http://server.com/dir1/dir2/).

My rewrite rule is this:

RewriteRule ^([a-z0-9'_/-]+)$ index.php?path=$1 [NC]

Basically I just want to take any request that doesnt have a dot in it,
and forward to index.php appending the requested path. This is inside
an .htaccess file located at /docroot/dir1/dir2/.htaccess. When I hit
http://server.com/dir1/dir2 I get a 400 Bad Request.
http://server.com/dir1/dir2/ works as expected, as does
http://server.com/dir1/dir2/some/path/here.

I have verified that ServerName is set properly in this VirtualHost
section. Am I doing something wrong here, and/or is there any way to
get further information about the error?

Thanks,

Mike

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com