Forum Moderators: phranque

Message Too Old, No Replies

Internal rewrites and SEO

         

Mister_L

6:26 pm on Aug 28, 2011 (gmt 0)

10+ Year Member



Hi,

Say you have a rewriterule that performs internal url rewrite without a 301/302 header,for example:

RewriteRule /symbolic/path ../file.php?var=1

Now you basically have 2 different urls that lead to the same content.
Does it have any impact whatsoever on SEO these days?

g1smd

6:56 pm on Aug 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You don't necessarily have two URLs.

You have a URL used out on the web and a path used inside the server.

If you are worried about the internal path being exposed out on to the web as a URL, then set up a redirect so that "external" URL requests for that direct internal path are externally redirected to the correct URL.

Failure to do so can lead to Duplicate Content issues.

"server-path" is the real location of the content inside the server. It's a path without a domain name.

"url-path" is the path used in the URL as advertised in links on the web, e.g. http://www.example.com/url-path

The condition to detect external URL requests for the "wrong" path uses a preceding RewriteCond looking at THE_REQUEST.


# Redirect external requests for www.example.com/server-path
# to advertised URL at www.example.com/url-path
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /server-path\ HTTP/ 
RewriteRule ^server-path$ http://www.example.com/url-path [R=301,L]


# Rewrite requests for www.example.com/url-path
# to internally fetch content from /server-path
RewriteRule ^url-path$ /server-path [L]