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
-
With 301 Redirects Does Changing URLs Matter?
We are redesigning our website in order to give it a more modern visual look. For the most part all the content will remain the same. Our old site is hosted on .asp so all of our current URLs look something like this: www.example.com/products/food.asp We plan on using 301 redirects in order to update every URL and remove the .asp. Since we are going to be doing 301 redirects for every existing URL anyways, does it matter from an SEO and ranking standpoint, if we also change the content and structure of the URL? For example, would we see a ranking impact if we were to change the above example URL to www.example.com/food? Obviously we want to try to retain as much link juice and ranking factors as possible during this redesign. Another issue we are seeing is with the image file names of our existing website images. We are moving to a new CMS platform (WordPress) that automatically saves images using a folder path similar to this: wp-uploads/2015-08/food. Will that change affect our SEO or ranking at all? When Google crawls an image does it care about the full path? Any insight would be much appreciated! 🙂
On-Page Optimization | | BlueLinkERP0 -
301 Redirect to external site
Hi guys, We have a client who is getting their website redesigned through us. They are discontinuing couple of their services which will not get featured in the new site. They are fairly well ranked for these services and my client wishes to 301 redirect these pages to an external site owned by his friend so that they benefit out of the ranking. The question is: Will my client's website's general ranking get affected due to 301 redirecting to an external site? The external site is not spammy or red-flagged by Google (at the moment, at least). Thanks in advance!
On-Page Optimization | | RameshNair
Ramesh Nair0 -
Page authority still on 1 after url change and 301 redirect
Hi Moz analytics suggestion to help ranking is to have a keyword or phrase in the url so I advised a client to do this they changed one of their pages urls, this page previously had a page authority of 26 since the change its gone down to 1.
On-Page Optimization | | genkee
I advised them that they must do a 301 from the old page but they took a few weeks to do this, would this of affected it why is it not showing up yet its been 3 weeks now, since the 301 and 5 weeks since the url change.0 -
Duplicate Page Content Should we 301 - Best Practices?
What would be the best way to avoid a Duplicate Page Content for these type of pages. Our website generates user friendly urls, for each page..
On-Page Optimization | | 365ToursSafaris
So it is the same exact page, just both versions of the url work.. Example: http://www.safari365.com/about-africa/wildebeest-migration http://www.safari365.com/wildebeest-migration I don't think adding code to the page will work because its the same page for the incorrect and correct versions of the page. I don't think i can use the URL parameter setting because the version with /about-africa/ is the correct (correct as it it follows the site navigation) I was thinking of using the htaccess to redirect to the correct version.. Will that work ? and does it follow best Practices ? any other suggestions that would work better ?0 -
301 to Intermediate Page then Rel=Canonical from Intermediate to target page
Hi I'm working on an eCommerce site and don't have direct access to the CMS. I had requested developers to provide me a facilty to 301 via htaccess however this is working slight differently. I need guidance from experts whether it's okay or not: Old Page: example.com/old Target New Page: example.com/new After Implementing the redirect, It redirects to an intermediate page or in other words, The same target URL with a question mark added: example.com/new? (notice the question mark in the new URL) This intermediate page has a canonical tag for the exact target URL. So, if I 301 redirect example.com/old to example.com/new? (Intermediate page) and If the intermediate page example.com/new? has a canonical tag for the exact target URL (example.com/new), Will I be able to pass the link juice and authority of old page to the new page?
On-Page Optimization | | Ankkesh0 -
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 -
301 in place, still many 404 in GWT. Why?
We have redesigned a website. The old site used to have lots of urls, the new sites has far less. We have pointed all old urls to the new urls with 301 redirects. This happened a couple of weeks ago. But we are still getting many 404 errors in Google Webmaster Tools. What's the reason for this? Thanks in advance.
On-Page Optimization | | gerardoH0 -
Correct use of Canonical link vs 301 redirect
Hi All, Seeking yet more advice. SEOMOZ tools have told me I have duplicate content on one of my sites and I am keen to clean this up. I am not to familiar with the following so thought I would ask. The duplicate content is shown on : www.mysite.com www.mysite.com/index.html Obviously I only see index.html when I check the code so what is the best method of resolving the duplicate content, Canonical or 301? Can you give me an example 🙂 Thanks all
On-Page Optimization | | wedmonds0