301 rediects - weird characters
-
Hi,
Just cleaning up some 404 errors in my site in GWT and noticed a couple of external links pointing at me that are wrong.
Basically they are from a couple of DIY forum sites (I've not put these links in place myself they are 100% natural) and it appears that the owners of the forums amend the links (inserting characters into link) so they are not quite right.
How would I go about redirecting the following -
www.example.co.uk/blueberry_pie.htm
Whatever I try doesn't work and I always end up with a 404!
Cheers
J -
So was it escaping the special characters that did the trick, Ted?
-
Got it working! Should have cleared my cache first!
Cheers
Ted
-
Hi Paul,
Got it working, should have cleared my cache first! Tried Fetch as Google and it works!
Thanks for your help!
Ted
-
Are you writing the redirects directly into an htaccess file, Teddi? Or into a plugin like WordPress's Redirection plugin?
-
Hi Paul
Just tried and it didn't work, when looking in the html code the link appears as the following
http://www.example.co.uk/blue<u>berry_pie.htm
Would I stick the '' in before each of the % signs?
Cheers
T -
Where are you putting the redirect? The following code should work in your .htaccess file, regardless of the special character:
redirect 301 /blueberry_pie.htm http://www.example.com/new-url.htm
-
Thanks text marketing, the question is how as because of the strange within the link it does not seem to work when I set up the 301 redirect.
-
You're going to need to escape the unusual characters in the URL in order to redirect them, Teddi.
When writing redirects, characters like < and > have special meaning as Regular Expression characters, so your server is trying to process those characters as their special regex functions, instead of just being plain old characters.
The way to turn them back into regular old characters is to place a "****" in front of the special characters.
So... the URL you are trying to redirect should be written as
www.example.co.uk/blue<u>berry_pie.htm</u>
Try that & let me know if it solves your problem.
Paul
-
If you want to get the "SEO juice" from those pages that link to you, you can simple set up a 301 redirect to the page it's supposed to be pointed to. That should work just fine!
Hope that helps!
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
-
How to do this 301 redirection
Hi there! I have two domains with the same content. Some guys in this forum posted that It would be convinient to do a 301 redirect from one ".com" domain to ".es" domain (my potential market). I just tried to set it up in the htaccess file but it dind't worked at all. Something like: redirect 301 http://wwww.domain.com http://www.domain.es I just configure in the webmaster tools the domain www.domain.com as preferred domain insted of http://domain.comThe same with the other domain. Any help? many thanks
On-Page Optimization | | juanmiguelcr0 -
How bad is it going over 70 character for title tag length?
I know less than 70 is recommended. I am about to run a script to create some title tags and a few will be between 71-74. Is going just the few characters over ok until I can get in there and manually do them?
On-Page Optimization | | EcommerceSite0 -
Which is better, have our location in the title or have a title that is 66 characters?
I was told by an SEO company that I need to put our name and location in every page title, however, an seomoz.org campaign gave me warnings for having a page title that is too long. Which is better, have our location in the title or have a title that is 66 characters? We have both a physical and online store, so it would still be nice to direct foot traffic to our physical store.
On-Page Optimization | | HockSports0 -
Page title getting cut off in SERPS even though it's under 70 characters?
I re-wrote the page title of a home page for a site I'm working on and made sure it's under 70 characters (68 to be exact) to comply with best practices and make sure it doesn't get cut-off in the SERPS. It's still getting cut-off though and right when it gets to the brand/website name. Does a "-" have anything to do with it? Does that translate to an elipsis? Format: keywords - website/brand.com Can anybody tell me why this would be happening?
On-Page Optimization | | MichaelWeisbaum0 -
301 redirect OK for a newer version of a page that is a different url?
I have about 500 products with multiple urls for the same product, but different versions. I sell wine and have a different page for each vintage. I've decided that is not the best way to go, and want to point the older vintage pages to the latest version page, and make that the only page for the product as time goes on. Do I have to put a link in the text from each older page to the newer, or can I use a 301 to redirect them to the new page? I don't want google to think I'm pulling something funny.
On-Page Optimization | | JeanYates0 -
Use 301 redirects when deleting old products?
I'm removing old products (wines) from my site, and I've been using 301 redirects for each product page back to the winery page. My question is, am I using best practice? I want people who search for these now nonexistent products to go to the winery page where they will see what is now available. But does google approve? I've also tried leaving the product's page intact but saying that it is no longer available and putting a link in the text that points to the winery page. Which is better, in the eyes of the god google? Thanks!
On-Page Optimization | | JeanYates0 -
How do I fix a 404 with a 301
I understand the need for fixing 404's but I have yet to have a serious walkthrough of how to set up a 301. From all the talk on the forums and such I'm pretty sure this is easy but I've just never done it before and I could really use a walk through. Thanks
On-Page Optimization | | BenRWoodard1 -
301 redirect (www.domain.com/index to www.domain.com)
Hello, Please let me know what are the exact right steps in order to get rid of the duplicate content issues related with: www.domain.com/index.html same as www.domain.com without creating an infinite loop. Do you have a step by step guide posted within seomoz including 301 redirect for non www to www for all urls and index.whatever to main domain name without going into a infinite loop ? btw how to you spot the loop ? is it obvious like never ending refresh of the home page ? thanks a lot !
On-Page Optimization | | eyepaq2