Forum Moderators: phranque
RewriteRule ^[Ss]hop/[Mm]ens/[Tt]-shirts/([0-9]+)/([0-9]+)/$ /shop/index.php?c=$1&p=$2 [L]
above will FAIL for
#http://mywebsite.net/shop/Mens/[Tt]-shirts/44/1187
without the ' / ' at the end of URL
how can i modify my rewrite statement above so that both
.../44/1187/ or .../44/1187 will go to same website
eg. [apple.com...] AND [apple.com...]
both leads to same webpage.
thanks in advance!
I doubt that...
Either 301 redirect the trailing-slash URLs to the no-trailing-slash URLs, or 301 redirect the no-trailing-slash URLs to the trailing-slash URLs. Do not allow both URLs to directly return content.
Jim
For example, for a 'home page' at URL "example.com/", here's a perfectly-valid requested URL that has almost everything 'wrong' with it -- and this kind of valid but non-canonical URL variant will 'work' on many, many sites:
http://www.Example.Com.:80/index.php?bogus_query=blah
This URL should be 301-redirected to http://example.com/ to prevent many more than 32 (2^5) different URLs from directly returning the exact same content (because the subdomain and query-string spaces are practically infinite, the figure of 32 actually represents the lowest possible limit of duplicate URLs in this case). But you certainly don't want even 32 copies of your own 'page' competing with each other for search engine rankings!
Jim