Welcome Guest, Not a member yet? Register   Sign In
Routing URLs and trailing slashes
#6

(This post was last modified: 03-26-2015, 04:11 AM by Narf.)

(03-26-2015, 03:21 AM)Avenirer Wrote: did you try this?

Code:
RewriteRule ^(.*[^/])$ index.php?/$1/ [L]

... or rather this:

Code:
RewriteRule ^(.*)/?$ index.php?/$1/ [L]

Your rule would rejected requests that have a trailing slash.

Edit:

Actually, the OP's goal seems to be indeed to reject such requests. However, 'foo' being redirected to 'foo/' is not the same as both of them just returning the same content. Search engines should understand redirects and still only track 'foo/'.
Reply


Messages In This Thread
Routing URLs and trailing slashes - by peter - 03-25-2015, 06:43 AM
RE: Routing URLs and trailing slashes - by Rufnex - 03-25-2015, 09:13 AM
RE: Routing URLs and trailing slashes - by peter - 03-25-2015, 11:12 AM
RE: Routing URLs and trailing slashes - by Rufnex - 03-25-2015, 12:02 PM
RE: Routing URLs and trailing slashes - by Narf - 03-26-2015, 04:07 AM
RE: Routing URLs and trailing slashes - by peter - 03-26-2015, 08:48 AM
RE: Routing URLs and trailing slashes - by peter - 03-27-2015, 07:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB