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
-
Is it a good practice to reduce number of redirections (301) after a period of time?
Is it good to use disavow tool and get rid of old URLs i.e. links for pages and posts which we have deleted from our website and added 301 on them?
On-Page Optimization | | Ravi_Rana0 -
Is it better to shorten my existing url to use only keyword after domain with a 301 redirect from existing url
I have a long existing URL that has included my key word but the url has about 5 additional words in the text ( eg url would have " /super widgets in stock at the widget store " as url text after domain. keywords is super widget The URL was at the top of search results for my keyword for many years until recently. Is it better to shorten my url text to now use only my keyword " /super-widgets " after the domain with a 301 direct from my existing url to optimize it Thanks
On-Page Optimization | | mrkingsley2 -
301 twice redirect (no negative)
Can i made twice 301 redirect, because i got "droped" domain and i dont want negative effect to new website. Can i redirect users some other way with no negative effect for fresh website?
On-Page Optimization | | cerar0 -
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 -
Is there a recommended character limit for alt text tags?
I've searched around for a maximum number of characters to use when writing alt tags, but not seeing anything more than "don't keyword stuff." Is there a recommended number of characters?
On-Page Optimization | | KimCalvert0 -
How much juice do you lose in a 301 redirect?
Our site has a number of, shall we say, unoptimized URLs. I would like to change the URLs to be more relevant; if a page is about red widgets, the URL should be www.domain.com/red-widgets.html, right? I'm getting resistance on this, however, based on the belief that you lose something significant when you 301 an old URL to a new one. Now, I know that if you have a long chain of redirects, the spiders will stop following at some point, and that is a huge problem. That wouldn't apply if there's only one step in the chain, however. I've also heard that you lose some link juice in a 301, but I'm unsure how serious that problem actually is. Is it small enough that we'd win out in the long run with better-optimized URLs?
On-Page Optimization | | CMC-SD0 -
Which is better, a directory 301 redirect or each page in the directory?
A customer of mine has a site with lots of articles and they are all quite spammy. They have not been affected by penguin yet so they asked what to do. I suggested losing the articles directory and 301 redirect to either the home page or another important page. Would a 301 redirect on the entire directory to a single page be the way to go or add redirects from each page within the directory and spread out redirects to various pages in website? Or do you have a better suggestion?
On-Page Optimization | | anthonytjm0 -
Too many 301 redirects to home page - is this possible?
If a site has a bunch of 404’s that are basically old URL’s that no longer work and point to pages or documents that don’t exist anymore - Can someone clarify if it’s a problem when fixing a bunch of these 404’s to point them all to the home page? so if there is not really anywhere else that is applicable for the old broken URL, is it really a problem to 301 old pages to the site home page? I have read some different things on this recently on some different sites, so I just wondered what the latest thinking on this was….thanks...
On-Page Optimization | | inhouseninja0