Hi,
I have question about rewrite my home page from http://mysite.com to http://www.mysite.com. How to write a code for 301 redirect. Please help.
Hi,
I have question about rewrite my home page from http://mysite.com to http://www.mysite.com. How to write a code for 301 redirect. Please help.
having trouble 'seeing' what you are saying here. how would this be written so that the redirect would work correctly?
#Redirects product page 187 to index
RewriteRule ^index.php?main_page=product_info&cPath=65&products_id=187 http://www.example.com/ [R=301,L]
Look at the code several posts back. It has very similar constructs to what you need to use here.
Use a RewriteCond before the RewriteRule, and check the value of QUERY_STRING using a suitable pattern.
The pattern matching in RewriteRule matches only the path part of a URL.
That is, the pattern in RewriteRule sees only the emboldened part of the request:
The preceding part can be checked by looking at HTTP_HOST using a RewriteCond.Code:www.example.com/some/path/to-a-file?parameter=value
The following part can be checked by looking at QUERY_STRING using a RewriteCond.
So would someone be willing to look at my site and tell me the exact code I need? This is all above my head and my SEO guy says this is a major problem for me that needs fixing and why my PR is totally gone. I get a 302 before the 404 on deleted items. I'm willing to hire for services. Please let me know :) Thanks! Amy
Amy McCoy
Baby Gifts and Baby Gift Baskets
I'll bet you're using:This MUST be changed to:Code:ErrorDocument 404 http://www.example.com/index.php?main_page=page_not_foundLook in the .htaccess file for this code.Code:ErrorDocument 404 /index.php?main_page=page_not_found
The ErrorDocument directive must NOT contain a domain name.
im so sorry but i have been studying this thread for some time now trying to redirect a dynamic page (/index.php?main_page=product_info&products_id=537) to my index page (well preferably to the replacement product if possible but index if this is too complicated) and i am very out of my depth
im not using any seo mods to change urls, the only things i am using are rewrites for non www to www and index to root, but i can't for the life of me get the 301 redirect to work and i am trying to follow what you are saying about rewrite instead of redirect but again im really struggling, i dont know much about htaccess at all and im desperately trying to learn. is there anyway you could give a working example of what you are speaking about above please? i only have about ten products to redirect but they have pretty good rankings so i would like to redirect some of that back inot my site if possible.
with regards to the non www to www code i have used, i struggled with getting it to work on my server and ended up having to contact them direct for the code as no others worked that i had come across so that is what im using, i dont know if this is the reason for the old product 301 to diff page isnt working?
my htaccess is below:
any help at all would be very much appreciated.Code:RewriteEngine On #canonical redirect from non www to www RewriteCond %{HTTP_HOST} !^(www\.livvylou\.co.uk)?$ RewriteCond %{REQUEST_URI} !^/admin [NC] RewriteRule (.*) http://www.livvylou.co.uk/$1 [R=301,L] # Index Redirect to root RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(html?|php)\ HTTP/ RewriteRule ^index\.(html?|php)$ http://www.livvylou.co.uk/? [R=301,L] ErrorDocument 404 /index.php?main_page=page_not_found #redirect rss page to actual feed redirect 301 /rss.php http://www.livvylou.co.uk/feed/general/feed.xml #Redirect old products to index RewriteRule ^/index.php?main_page=product_info&products_id=537 http://www.livvylou.co.uk/ [R=301,L]
PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
**I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.
AMAZING!!!!
it worked, thank you SO much!
PRO-Webs, Inc. :: Recent Zen Cart Projects :: Zen Cart SEO – 12 Steps to Success
**I answer questions in the forum, private messages are NOT answered. You are welcome to contact us via our website for professional engagements.
Bookmarks