Forum Moderators: phranque

Message Too Old, No Replies

301 redirect from server and mirror

web pages are mirrored at separate web address, 301 redirect

         

DanielB

5:50 pm on Mar 17, 2012 (gmt 0)

10+ Year Member



My Internet provider has mirrored some of my web pages, so I have gained two web addresses for some of the pages in my site. As a result, Google and Yahoo have indexed my web pages equally between two web addresses. I only have one version of each page that I have uploaded to the 1 main server, and I am unable to login or gain access to the second server where the pages are mirrored. I tested both addresses, as soon as I upload a change to a web page to the main server, it is immediately updated to both servers. So they must both be live servers/addresses. I was hoping to point both current addresses to a single brand new address, since my high search engine results are currently equally split between the two existing addresses. Is a 301 redirect possible by placing both current web addresses in the htaccess file, then pointing to the single brand new site address? Will the mirrored versions of my pages also forward correctly? Is there an exact 301 redirect syntax for this? Thank you!

g1smd

7:33 pm on Mar 17, 2012 (gmt 0)

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



If you are redirecting, you will need to place the htaccess file on the other server.

However, is there really another server, or is it simply that multiple web addresses point to the same physical folder? It's easy enough to test.

phranque

3:39 am on Mar 18, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, DanielB!

most likely this is an alias domain and not a separate server.
do you have any hostname canonicalization redirects in your .htaccess?

DanielB

5:11 pm on Mar 18, 2012 (gmt 0)

10+ Year Member



Thank you for the replies, I have had this website residing with the same company for 11 years (a long time!) and it does not have an .htaccess file. Since my pages update immediately at both addresses when I upload them to the main address, I'm sure you are right about it the other just being an alias domain. I am hoping to to keep the high rankings each each web address possesses as they forward. Is there a way to use a 301 redirect or other method in my case? Thank you for the help!

g1smd

5:24 pm on Mar 18, 2012 (gmt 0)

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



Yes, use this code

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]


to redirect all non-canonical hostname requests to the main domain.

lucy24

7:23 pm on Mar 18, 2012 (gmt 0)

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



!
?

Or am I missing something?

g1smd

7:25 pm on Mar 18, 2012 (gmt 0)

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



That's my most common typo.

Replace with
^(www\.
with
!^(www\.
in the code above.