How can i redirect a url that has % in it?
-
Google webmaster tools shows a 400 eroor for an old link that contains a 30% off in it. The problem is the %
I would like to 301 redirect this link :
to
We do not know how to do this in httaccess. Can you please advise?
Thanks a lot!
Madlena
-
You need to encode it.
[komimoda@home ~]$ php echo urlencode('http://www.geographics.com/Graduation-Stationery,-35%-OFF-Printable-Certificates-Blank-Gift-Certificates/c1353_1354_1359/index.html'); ?> http%3A%2F%2Fwww.geographics.com%2FGraduation-Stationery%2C-35%25-OFF-Printable-Certificates-Blank-Gift-Certificates%2Fc1353_1354_1359%2Findex.html[komimoda@home ~]$
It's bombing on the %- that isn't a number after it. If you want to shoot me a email I can get it done for you for free? joseph@michael-chambers.com
Without db hashing, it's nearly impossible to get those from htaccess into a rewrite table lookup. %20 for sure. apache turns the char back to a space before passing it on for comparison. and text based of course, uses the space as a separater between match, and replacement. It probably also turns %25 back into a % before hash tables too. sorry tmi.
Oh look at this:
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 301 redirect the only way when using Vanity URLs?
We have been using vanity urls for some of our pages. Mostly the pages that have a vanity URL have a long URL length. But now the problem is, the vanity URL is getting displayed on the search engine when the particular keyword related to the page is entered. I checked the google search console, the vanity URL is indexed and the original URL remains unindexed. What should I do? Is adding 301 redirect to the vanity URLs are solution? Since some of vanity URLs are not redirecting to the original. Some of the original pages are not getting traffic. Also, can using canonical tag help?
Technical SEO | | tejasbansode0 -
Can a page that's 301 redirected get indexed / show in search results?
Hey folks, have searched around and haven't been able to find an answer to this question. I've got a client who has very different search results when including his middle initial. His bio page on his company's website has the slug /people/john-smith; I'm wondering if we set up a duplicate bio page with his middle initial (e.g. /people/john-b-smith) and then 301 redirect it to the existent bio page, whether the latter page would get indexed by google and show in search results for queries that use the middle initial (e.g. "john b smith"). I've already got the metadata based on the middle initial version but I know the slug is a ranking signal and since it's a direct match to one of his higher volume branded queries I thought it might help to get his bio page ranking more highly. Would that work or does the 301'd page effectively cease to exist in Google's eyes?
Technical SEO | | Greentarget0 -
Redirect Chain Domain
MozPro is highlighting some redirect chain issues with our domain that I do not recall ever setting up in our redirect list. In our Moz Pro Campaign I see the Site Crawl has flagged 36 Redirect Chain Issues. I understand how the redirect chain errors can happen but I do not recall ever manually redirecting our domain, yet I have http://stickylife.com, https://stickylife.com & https://www.stickylife.com all associated in one of our redirect chain errors. When looking at our redirect files I do not see any of these domain redirects and wonder how this has happened and how to fix it. It appears as though our HTTP and HTTPS is causing some redirection. I wonder if this is coming from our DNS settings?
Technical SEO | | StickyLife0 -
Should I keep a website which is outdated or close it down? It has a few links. If I keep it can I redirect people to our newer site?
We are in the process of buying some intellectual property, and it's websites are very dated and only have around 5 external links each. What's the best course of action? Do we close down the sites; then redirect the urls to our current website, or do we leave the sites up, but redirect people to our new site. Reference: current website: www.psychometrics.com Old sites that come with the intellectual property: http://www.eri.com/ plus http://www.hrpq.com/ Thanks, Dan Costigan
Technical SEO | | dcostigan0 -
Canonical URL Change
Hi, I have a Product Page, say www.example.com/product-title/.
Technical SEO | | viatrading1
Canonical URL is www.example.com/product-title/ I want to change its URL to www.example.com/product-title-2/
Canonical URL is www.example.com/product-title-2/
Can't do 301 Redirect. Is SEO Juice passed from www.example.com/product-title/ to www.example.com/product-title-2/ ? Thanks,0 -
IP redirects
My website, on a .com domain, displays a different language/content depending on the IP of the user. For example, if someone is browsing my web from Spain, it will show the spanish content, and so on. Does anyone has an idea on how will Google index my pages? Their servers being located in the US, I assume the bot will only crawl and index the english content. How can I tell the bots to do the same for the other languages/content? Thanks!
Technical SEO | | Alemoto0 -
Correct Redirect method for switching pages from .html to /pretty urls/
I have a customer that has all his site files as .html extensions and i'm going to rebuild this site into a wordpress site for easier management, regarding the new permalink structure, should i just do a 301 redirect on this?
Technical SEO | | tgr0ss0 -
Should I be redirecting a .gov.au domain to a .com/.com.au Marketing URL?
Hi everyone, First time post - what a great community! On a trial at the moment but will definitely be signing up to PRO. The situation I'm helping to promote an event in Australia (lets call it "myevent"). The event also goes by a nickname "myev" (which isn't searched as much as "myevent"). The event for the most part is promoted offline as www.myevent.com. As it currently stands (and appears to have been the case for a number of years), www.myevent.com and www.myevent.com.au 302 redirect to www.mylocation.gov.au/myev The event is pretty much number 1 for keywords around "my event" and "myev", despite little attention being paid to on page optimisation and issues around duplicate content which I intend to fix. The domain being indexed by Google is www.mylocation.gov.au/myev . Open site explorer stats Open Site explorer shows www.mylocation.gov.au/myev as having a strong domain authority, and hundreds of backlinks. www.myevent.com and www.myevent.com.au have domain authorities in the 20s and about 30-40 backlinks each. The conundrum I've had a chat with the IT guys running the site(s) and they mentioned they'll be switching the way the redirects work, so everything goes to www.myevent.com NOT the .gov.au URL. I've done a bit of reading on the forums and understand that 301s should be used in order to pass the juice/authority from the existing domain (in this case www.location.gov.au/mye). I understand not all of this will be passed. What I'm not sure about is which URL should be the final preferred destination. I may not have a choice - www.myevent.com has been the preferred URL for a long time - but want to know if this will affect the performance in search results if the .com.au isn't used as the final destination (even though we would be redirecting from it)? Any suggestions / ideas / help would be most appreciated. I hope this all makes sense - I'm relatively new to the whole SEO world! Best wishes and many thanks.
Technical SEO | | hergs0