Forum Moderators: phranque

Message Too Old, No Replies

simple mod rewrite but need help

         

Buster13

8:19 am on Nov 23, 2009 (gmt 0)

10+ Year Member



#http://mywebsite.net/shop/Mens/[Tt]-shirts/44/1187/

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!

jdMorgan

2:12 pm on Nov 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You want to create a duplicate-content problem so that neither URL ranks as well as it should?

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

Buster13

4:23 pm on Nov 23, 2009 (gmt 0)

10+ Year Member



now that you mention it. i went to apple website and check...they do convert non-slash to slash.

i will follow your advise and 301 redirect non-slash to slash. thank you so much!

jdMorgan

6:06 pm on Nov 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, we spend an awful lot of time in this forum and in the search engine forums discussing duplicate-content issues; In general, for any given 'page' of content, you want one and only one URL to be usable to directly-access that content; any and all other variations of http/https protocol, subdomain, domain, FQDN, port number, URL-path, and query string -- and all case-variations of all of these, should be 301-redirected to the single canonical URL.

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