301 Redirect NOT Working as Expected - HELP!
-
Hi!
I just launched our newly coded site and just realized the installed 301 is NOT working. The URL string is the same EXCEPT for the removal of /shop/. Here is the code in .htaccess:
############################################
enable rewrites
Options +FollowSymLinks
RewriteEngine on
#RedirectMatch 301 ^/shop?/$ http://hiphound.com/
RedirectMatch 301 ^/shop?/$ http://hiphound.com
###########################################
When I go to Google and click on an old link I get a 404. No bueno!! Here is an example:
http://hiphound.com/shop/rubit-dog-tag-clip
I thought (and was told) that the installed 301 would send this page to:
http://hiphound.com/rubit-dog-tag-clip
It's not. Please HELP!! What am I doing wrong???
Lynn
-
Hi!!
Yeah strange. Here is the code the hosting guys came up with:
############################################
enable rewrites
Options +FollowSymLinks
RewriteEngine ONRewriteCond %{HTTP_HOST} ^www.(.)$ [NC]
RewriteRule ^(.)$ http://%1/$1 [L,R=301]RedirectMatch 301 ^/shop/(.*)$ http://hiphound.com/$1
############################################
The first rule is for www to non-www redirection and the second rule is for my URL structure change.
Thanks so much for your help!
Lynn
-
Hmmm thats weird, it worked on my site. Anyways I just checked out your site and it looks like you figured it out, what ended up working for you?
-
Hi!
Tried that and same issue. 404. Ugh!!!
What the heck am I doing wrong? Thanks for the feedback. It is appreciated.
Lynn
-
Try this, I think this it what you are trying to do.
Redirect 301 /shop/ http://www.hiphound.com/
However, if you want to change where it goes, and add an extension, like the # you would do this
Redirect 301 /shop/ http://www.hiphound.com/#
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Why can't I redirect 302 errors to 301's?
I've been advised by IT that due to the structure of our website (they don't use sub-folders) it's not possible to change 302's to 301's. Is this correct, or am I being fobbed off?
Technical SEO | | lindsaytuerena0 -
Virtual inlcude v.s. Redirect 301
Hi there, I manage a website which use a lot virtual includes ( SSI) because it caused a lot of duplicate content i introduced the Canonical url tag. But i still see bad rankings on some pages who are the leading of the virtual includes. Now i'am wondering is it better to remove all the virtual include pages ( url's) and make a redirect 301 of it. Does anybody know that is better for ranking the head page?
Technical SEO | | JoostBruining0 -
301 Redirect for 3 Domains into 1 New Domain
So I wanted a quick sanity check on the htaccess syntax for migrating 3 domains into 1 new domain. For example, we're migrating 3 sites abc.com, def.com and ghi.com, all into 1 new site on ghi.com. Here's the htaccess we're placing on the root of ghi.com: redirect 301 http://www.abc.com/wines.html http://www.ghi.com/wines redirect 301 http://www.def.com/trade.html http://www.ghi.com/trade
Technical SEO | | cmaseattle
redirect 301 http://www.ghi.com/winery-tours.html http://www.ghi.com/visit/taste On the DNS side of things, we're parking abc.com and def.com on the ghi.com server. I'm not seeing examples of htaccess files for this scenario, and none that use any domain info on the "from" side of the redirect 301 syntax. Any suggestions before we pull the trigger? Thanks!0 -
How do I 301 redirect a number of pages to one page
I want to redirect all pages in /folder_A /folder_B to /folder_A/index.php. Can I just write one or two lines of code to .htaccess to do that?
Technical SEO | | Heydarian0 -
Do I need a 301 redirect on htaccess if Apache is already configured to serve?
Apache is set up to serve both www and non-www versions the same content. Do I still need to put a 301 redirect in the htaccess file?
Technical SEO | | Ocularis0 -
Rel=cannonical + 301 redirect
Hi All I am currently working on a DotNetNuke site. I have enabled friendly URL's which have changed the url structure from the default setting of TabId=x to whatever the page name is set as. I will use the following page as an example - www.notarealdomain./graphicdesign.aspx Now I would like to know if it would be worth my time to change this to "/graphic-design.aspx through the use of a 301 redirect and/or a rel=can. Any help would be much appreciated. Thanks
Technical SEO | | masterpete0 -
Google Webmaster redirect vs 301 redirect
OK assuming a client's website has the right tracking script (hopefully analytics isn't effected by this issue), ... what happens if the htaccess file has a 301 redirect to the www-address, but within Google Webmaster Tools, the address chosen to crawl by Google is the non-www address? How will Google handle and which address takes precedence in this situation? _Cindy
Technical SEO | | CeCeBar0 -
Wordpress 301 redirects
I use wordpress as CMS on a few sites and I noticed that word press automattically places 301s if I change a url etc. I believe it does it by having the following in the .htaccess file: BEGIN WordPress<ifmodule mod_rewrite.c="">RewriteEngine OnRewriteBase /RewriteRule ^index.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</ifmodule> END WordPress Should I use this? I feel like it limits my control over the 301s.
Technical SEO | | mmaes0