strange trailing slash issue

Go To


I have a folder under document_root in Apache server. When I type in, it does not redirect to, but goes to Note that there are two slashes after the domain name.

I couldn't find any mod-rewrite rule set up for this kind of redirect. Can anyone think of any other possible reason?

Also, in Apache, redirecting from to is done by what? (Note 'help' is real folder, and there is not a file named 'help').


2012-04-04 02:42
by Adam C.


Finally I found out that this is a bug of Apache.

2012-04-04 21:11
by Adam C.


First guess is that your application configuration has an item for its base URL, and in your case, it ends with /, causing the application's internal routing system to add the extra slash.

Replying to asker comment:

Look in your .htaccess file. If it looks something like this (this is the one used by WordPress installations by default, by the way):

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

Then it will attempt to load from the actual directory /help. But if it does not contain the !-f and !-d lines, it will load every request via the application entry point, whether the requested item exists in the file system or not.

2012-04-04 02:45
by Ariel
Thanks. But it does not help. Note that 'help' is a real folder, so we should not expect any redirect - Adam C. 2012-04-04 02:56
Comments can't do newlines? annoying... Updated initial answer - Ariel 2012-04-04 03:04
I think "! -f" means not file, and "! -d" means not directory. "help" is directory, so no rewrite rule applied. We are not using wordpress anyway - Adam C. 2012-04-04 13:41