Removing trailing slashes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a FAQ, but need some additional info I haven't been able to find. I'm trying to process links Google has indicated are 404s that never really ever existed on our site.

I have an htaccess file I'm Including with my main apache config that only contains RewriteConds. This file is processed before any of the other htaccess files that contain standard RewriteRules. This is what I'm using to strip off any trailing slashes in URLs:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]

I just want to confirm that this means none of the RewriteRules that follow should contain a trailing slash or they will not match, correct?

Some of my existing RewriteRules that were created before I realized I should be stripping off the trailing slash actually contain a trailing slash.

Perhaps I should instead be using '/?' instead of just '/' at the end of URLs?

Thanks,
Dave



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux