Forum Moderators: phranque

Message Too Old, No Replies

301 redirect not working

301 magento site not working

         

counterfoxx

9:30 am on Aug 9, 2012 (gmt 0)

10+ Year Member



Hi,

I have recently just made a clients website live (it is built based on Magento). However when searched in google the subcategories (such as ‘Contact Us’ link to the home page.) The contact page for example is simply a static page which has the url similar to [mydomain.co.uk...]

However when clicked from the google results the url looks like: [mydomain.co.uk...]
which always goes to the homepage.

I have tried modifying the .htaccess file to include the text:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^pg=6$
RewriteRule ^/index.php$ [mydomain.co.uk...] [L,R=301]

However still with this clicking the ‘Contact Us’ page from google still goes to the index page with the url [mydomain.co.uk...]

If anyone could help me with this it would be extremely useful, I don’t know what I’m doing wrong.

Thanks in advance!

lucy24

12:08 pm on Aug 9, 2012 (gmt 0)

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



Never mind the Redirect. You need to figure out how g### is generating that URL, and squash it right away. Google will sometimes invent URLs out of its own fevered imagination, but more often they come from swooping in on typos or coding blunders in your own page.

Your RewriteCond will only succeed if "pg=6" is the entire query string.

Your RewriteRule will probably only work in a config file. In htaccess you don't use the leading / in the pattrn.

And now go read that Sticky about using example.com. Or, in this case, example.co.uk.