Suggestions in redirecting an old URL to new URL with parenthesis () ?
-
What should I use in .htaccess if I will redirect an old URL with parentheses to a new URL like below?
RedirectMatch 301 http://www.olddomain.com/buy/nike-shoes/kobe(7)/red http://www.newdomain.com/buy/nike-shoes/kobe(7)/red
Or
RedirectMatch 301 http://www.olddomain.com/buy/nike-shoes/kobe(7)/red http://www.newdomain.com/buy/nike-shoes/kobe(7)/red
-
So did that process of escaping the special characters solve your issue, esiow?
-
I'll try this one. Big help ThompsonPaul! I'll let you know if this works. Thanks a lot!
-
The successful way to accomplish this can depend a bit on your server configuration, esiow, but the most likely workable and reliable solution is to "escape" the non-standard URL characters. (Actually, the best solution would be to get rid of the unsafe URL characters altogether, but that's not what you asked )
.htaccess rewritedirect rules are essentially regular expressions or regexp. In regexp, many non-URL characters are used to format different commands. So having them as an actual URL character causes the redirect rule to try to process them as regexp instead of as just a URL character. Whew - hope that makes sense.
To tell the redirect rule to treat the non-standard character as an actual character instead of a command - you "escape" it by adding a "****" (without the quotes) in front of each character that could be a problem.
So:
RedirectMatch 301 http://www.olddomain.com/buy/nike-shoes/kobe(7)/red http://www.newdomain.com/buy/nike-shoes/kobe(7)/red
becomes:
RedirectMatch 301 http://www.olddomain.com/buy/nike-shoes/kobe***(7***)/red http://www.newdomain.com/buy/nike-shoes/kobe***(7***)/red
Give that a try in your .htaccess file and let us know if it works. if not, there may be a couple other options to try.
Hope that helps?
Paul
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
-
Never ending new links and our rank continues to plumet
HI everyone, I've been having an issue with a severe drop in rankings (#2 to #36ish). All of my technicals seem to be ok, however I seem to be getting my images hotlinked (which I have killed in nginx) from these spam like pages that pull and link to an image on my site, then link again with a " . " for the anchor. Even more strange is that these pages are titled and marked up with the same titles and target key words as my site. For example, I just got a link yesterday from a site leadoptimiser - d o tt- me which is IMO a junk site. The title of the page is the same as one of my pages, the page is pulling in images relevant to my page, however the image sources are repos EXCEPT for 2 images from my site which are hotlinked to my pages image and then an additional <a>.</a> link is placed to my website. I have gotten over 1500 of these links in the past few months from all different domains but the website (layout etc) is always the same. I have been slowly disavowing some of them, but do not want to screw up anything in case these links are already being discounted by G as spam and not affecting my rank. The community seems to be really split on the necessity of disavowing links like these. Because of these links, according to Ahrefs, my backlink profile is 38% anchor text of "." . Everything else checks out in my own review as well as Moz tools and Ahrefs with very high quality scores etc. Webmasters is fine, indexing is fine, pagespeed insights is in the 90's, ssl is A+. I've never had to deal with what seems to be an attack of this size. Thanks.
White Hat / Black Hat SEO | | plahpoy1 -
Url suddenlly diappeared from Google search results
Hi, I am facing a big problem wheel Google stop showing a basic url of my site, It was ranked good for more than 35 keywords from 1st to 8st positions, and suddenly I can find it indexed in Google , this is the URL : http://tv1.alarab.com/view-8/مسلسلات-عربية Thnaks
White Hat / Black Hat SEO | | alarab.net0 -
Magento Temporary Redirects?
Just checked my Crawl insights. I have 1981 on Moz 302 redirects - temp I'm not too familiar with Magento - however site domain has moved from .com to .co and although I have set a 301 redirect on the base domain through hta I am assuming it is also temporary redirecting things in the CMS itself? The temporary directs that the site is creating are still on the new domain - but are really odd! Eg Wishlist, Product compare links .co/wishlist/index/add/product/498/form_key/5e7CQkZ54tMSsJtwAnyone have ideas in regards to this?
White Hat / Black Hat SEO | | Kelly33301 -
Content optimized for old keywords and G Updates
Hi, We've got some old content, about 50 pages worth in an Ecommerce site, that is optimized for keywords that aren't the subject of the page - these keywords occur about 8 times (2 keywords per page) in the old content. We are going through these 50 pages and changing the title, H1, and meta description tag to match the exact subject of the page - so that we will increase in rankings again - the updates have been lowering our rankings. Do we need to completely rewrite the content for these 50 pages, or can we just sprinkle it with any needed additions of the one keyword that is the subject of the page? The reason I'm asking is that our rankings keep dropping and these 50 pages seem to be part of the problem. We're in the process of updating these 50 pages Thanks.
White Hat / Black Hat SEO | | BobGW0 -
Competition Link Metrics Analysis - Do you have any suggestions ?
My sub-pages are ranking well, but Homepage isn't ranking well for the keywords I'd like it to. It used to in the past. My site - njhypnotherapy.com used to rank (#2-5) 1st page in google for many keywords. In Sep/Oct I noticed my homepage ranking drop dramatically for the main keywords. Well, I made some foolish decisions and I'm trying to clean up the mess. Low quality links, duplicate content...etc I rewrote most of the content, removed unnecessary pages, removed as many low quality links, and used disavow for the rest. It's been a 2 Weeks now. I noticed a lot of improvements in my sub-pages. From #50 to #20. Not Bad. My homepage still isn't ranking. Any suggestions to improve? Btw, I've included my link metrics below if it helps 🙂 Thank You metricks.png
White Hat / Black Hat SEO | | njhypnotherapy0 -
Where is the rule here that forces any home page URLs that include several versions of explicit page name references, such as default.htm or index.html, to redirect to the canonical homepage?
RewriteRule ^search/([a-zA-Z0-9,-]+)/sort-([a-z0-9-]+)/(1)?$ /search/$1/sort-$2 [R=301]
White Hat / Black Hat SEO | | esiow2013
RewriteRule ^search/([a-zA-Z0-9,-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=search&q=$1&page=$5&sort=$2 [L]
RewriteRule ^search/([a-zA-Z0-9,-]+)/(1)?$ /search/$1 [R=301]
RewriteRule ^search/([a-zA-Z0-9,-]+)((/)([0-9]+))?$ index.php?cmd=search&q=$1&page=$4 [L]
RewriteRule ^([r|R])-([0-9]+)((-)([0-9a-zA-Z-]+))?$ index.php?cmd=propertyPage&id=$2&group=1 [L]
RewriteRule ^([s|S])-([0-9]+)((-)([0-9a-zA-Z-]+))?$ index.php?cmd=propertyPage&id=$2&group=2 [L]
RewriteRule ^reset-password$ index.php?cmd=retrievePassword [L]
RewriteRule ^reset-password/([0-9]+)/([a-zA-Z0-9]+)$ index.php?cmd=retrievePassword&act=retrievePasswordConfirm&code=$1&key=$2 [L]
RewriteRule ^map-page.php$ index.php?cmd=mapPage [L]
RewriteRule ^advertise.php$ index.php?cmd=advertiseWithUs [L]
RewriteRule ^my-account.php$ index.php?cmd=protectedMyAccount [L]
RewriteRule ^bookmarked-properties(/((R|S)-([0-9]+)))?$ index.php?cmd=protectedBookmarkedProperties&id=$2 [L]
RewriteRule ^bookmarked-properties/([0-9]+)$ index.php?cmd=protectedBookmarkedProperties&page=$1 [L]
RewriteRule ^bookmarked-properties/delete/([0-9,]+)$ index.php?cmd=protectedBookmarkedProperties&act=protectedBookmarkedProperties_delete&id=$1 [L]
RewriteRule ^register.php$ index.php?cmd=register [L]
RewriteRule ^about-us.php$ index.php?cmd=aboutUs [L]
RewriteRule ^news(/([0-9]+)(.*))?$ index.php?cmd=news&id=$2&title=$3 [L]
RewriteRule ^registration/confirm/key=([a-zA-Z0-9]{150})/code=([a-zA-Z0-9]{5})$ index.php?cmd=register&act=registerConfirm&key=$1&code=$2 [L]
RewriteRule ^terms-and-conditions.php$ index.php?cmd=termsAndConditions [L]
RewriteRule ^privacy-policy.php$ index.php?cmd=privacyPolicy [L]
RewriteRule ^contact-us.php$ index.php?cmd=contactUs [L]
RewriteRule ^sitemap.php$ index.php?cmd=siteMap [L]
RewriteRule ^members/login.php$ login.php [L]
RewriteRule ^rss$ index.php?cmd=rss [L]
RewriteRule ^resources.php$ index.php?cmd=links [L]
RewriteRule ^links.php$ /resources.php [R=301]
RewriteRule ^resources2.php$ index.php?cmd=links2 [L]
RewriteRule ^results.php$ index.php?cmd=results [L]
RewriteRule ^residential-properties((/)([0-9]+))?$ index.php?cmd=divisionsRoot&mainDivision=1&page=$3 [L]
RewriteRule ^commercial-properties((/)([0-9]+))?$ index.php?cmd=divisionsRoot&mainDivision=2&page=$3 [L]
RewriteRule ^short-term-rentals((/)([0-9]+))?$ index.php?cmd=divisionsRoot&mainDivision=1&str=1&page=$3 [L]
RewriteRule ^buy((/)([0-9]+))?$ index.php?cmd=divisionsRoot&group=2&page=$3 [L]
RewriteRule ^rent((/)([0-9]+))?$ index.php?cmd=divisionsRoot&group=1&page=$3 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&str=1&sort=$2&page=$5 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&str=1&sort=$4&page=$7 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&str=1&sort=$5&page=$8 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&str=1&page=$7 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)/([a-z_-]+)/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&str=1&page=$6 [L]
RewriteRule ^short-term-rentals/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&str=1&page=$4 [L]
RewriteRule ^rent/residential-properties/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&sort=$5&group=1&page=$8 [L]
RewriteRule ^buy/residential-properties/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&sort=$5&group=2&page=$8 [L]
RewriteRule ^lease/commercial-properties/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1®ion=$2&city=$3&area=$4&sort=$5&group=1&page=$8 [L]
RewriteRule ^buy/commercial-properties/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1®ion=$2&city=$3&area=$4&sort=$5&group=2&page=$8 [L]
RewriteRule ^rent/residential-properties/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&sort=$2&group=1&page=$5 [L]
RewriteRule ^buy/residential-properties/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&sort=$2&group=2&page=$5 [L]
RewriteRule ^lease/commercial-properties/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1&sort=$2&group=1&page=$5 [L]
RewriteRule ^buy/commercial-properties/([a-z_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1&sort=$2&group=2&page=$5 [L]
RewriteRule ^rent/residential-properties/([a-z_-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&group=1&page=$7 [L]
RewriteRule ^buy/residential-properties/([a-z_-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1®ion=$2&city=$3&area=$4&group=2&page=$7 [L]
RewriteRule ^lease/commercial-properties/([a-z_-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1®ion=$2&city=$3&area=$4&group=1&page=$7 [L]
RewriteRule ^buy/commercial-properties/([a-z_-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1®ion=$2&city=$3&area=$4&group=2&page=$7 [L]
RewriteRule ^rent/residential-properties/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&group=1&page=$4 [L]
RewriteRule ^buy/residential-properties/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$1&group=2&page=$4 [L]
RewriteRule ^lease/commercial-properties/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1&group=1&page=$4 [L]
RewriteRule ^buy/commercial-properties/([a-z_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$1&group=2&page=$4 [L]
RewriteRule ^rent/residential-properties/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$2®ion=$3&city=$4&area=$5&category=$1&group=1&page=$8 [L]
RewriteRule ^buy/residential-properties/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$2®ion=$3&city=$4&area=$5&category=$1&group=2&page=$8 [L]
RewriteRule ^lease/commercial-properties/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$2®ion=$3&city=$4&area=$5&category=$1&group=1&page=$8 [L]
RewriteRule ^buy/commercial-properties/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z,()0-9_-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$2®ion=$3&city=$4&area=$5&category=$1&group=2&page=$8 [L]
RewriteRule ^rent/residential-properties/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$2&category=$1&group=1&page=$5 [L]
RewriteRule ^buy/residential-properties/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=$2&category=$1&group=2&page=$5 [L]
RewriteRule ^lease/commercial-properties/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$2&category=$1&group=1&page=$5 [L]
RewriteRule ^buy/commercial-properties/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=2&country=$2&category=$1&group=2&page=$5 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()0-9_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2®ion=$3&city=$4&area=$5&category=$1&sort=$6&page=$9 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()0-9_-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2®ion=$3&city=$4&area=$5&category=$1&sort=$6&page=$9 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2®ion=$3&city=$4&category=$1&sort=$5&page=$8 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2®ion=$3&city=$4&category=$1&sort=$5&page=$8 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2®ion=$3&city=$4&area=$5&category=$1&page=$8 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2®ion=$3&city=$4&area=$5&category=$1&page=$8 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2®ion=$3&city=$4&category=$1&page=$7 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)/([a-z()-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2®ion=$3&city=$4&category=$1&page=$7 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2&category=$1&sort=$3&page=$6 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)/sort-([a-z0-9-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2&category=$1&sort=$3&page=$6 [L]
RewriteRule ^rent/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=$2&category=$1&page=$5 [L]
RewriteRule ^buy/([a-z,-]+)/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=$2&category=$1&page=$5 [L]
RewriteRule ^rent/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain_categories&mainDivision=1&country=$1&group=1&page=$4 [L]
RewriteRule ^buy/([a-z()-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain_categories&mainDivision=1&country=$1&group=2&page=$4 [L]0 -
2 Questions about 301 Redirects
So I have a couple of questions about 301 redirects: Do Google penalties EVER pass through a 301? I've done 20+ domain 301s in the last year and have yet to see it happen, but the other day I read a an article (or maybe it was a QA post?) that suggested doing 302s to avoid transferring penalties. Has anyone seen any authoritative information regarding this? I 301'd a domain in February that another SEO firm had built a lot of spammy links and I began building contextual links for it at a very slow rate (like 10 or so a month). Within a month, my domain authority was a 26 on the new domain and my inbound links were non existent. By month 2, my links were 70k and domain authority was 34. By month 3, down to 25k inbound links and domain authority of 29, where it has settled for the last 3 months despite some really high quality links. My question (don't worry it's coming), is does anyone have any clue why my links shot up so quickly and then dropped? I'm assuming the 301 links kicked in and then only about 45% ended up 'sticking'?? Thanks in advance
White Hat / Black Hat SEO | | BrianJGomez0 -
New sub-domain launches thousands of local pages - is it hurting the main domain?
Would greatly appreciate some opinions on this scenario. Domain cruising along for years, top 1-3 rankings for nearly all top non-branded terms and a stronghold for branded searches. Sitelinks prominently shown with branded searches and always ranked #1 for most variations of brand name. Then, sub-domain launches that was over 80,000 local pages - these pages are 90-95% similar with only city and/or state changing to make them appear like unique local pages. Not an uncommon technique but worrisome in a post Panda/Penguin world. These pages are surprisingly NOT captured as duplicate content by the SEOMoz crawler in my campaigns. Additionally about that same time a very aggressive, almost entirely branded paid search campaign was launched that took 20% of the clicks previously going to the main domain in organic to ppc. My concern is this, shortly after this launch of over 80k "local" pages on the sub-domain and the cannibalization of organic clicks through ppc we saw the consistency of sitelinks 6 packs drop to 3 sitelinks if showing at all, including some sub-domains in sitelinks (including the newly launched one) that had never been there before. There's not a clear answer here I'm sure but what are the experts thoughts on this - did a massive launch of highly duplicate pages coupled with a significant decrease in organic CTR for branded terms harm the authority of the main domain (which is only a few dozen pages) causing less sitelinks and less strength as a domain or is all this a coincidence? Or caused by something else we aren't seeing? Thanks for thoughts!
White Hat / Black Hat SEO | | VMLYRDiscoverability0