Redirect
-
How do I redirect this url:
Thank you for your help.
-
Hi Keri, you just pushed me to go forward with that problem. Yes, Mike's suggestion works perfect!
-
Hi Mike, sorry for my delayed answer (I have been on holiday in between an this means always busy time before and after... and this item was not the most important one. The problem with my mentioned redirect above has been that it worked, BUT the image itself (which is of course in use on the website) was not visible any more.
And your solution works perfect - I just tried it out. Thank you
-
Petra, did this work for you?
Keri [SEOmoz associate]
-
So I think you are trying to redirect a query parameter request to your home page, right? So that this:
/m/imgres?q=short+holiday+treatments
is redirected to this:
/
Correct? If so, try this:
RewriteCond %{QUERY_STRING} ^(.)short+holiday+treatments(.)$
RewriteRule ^(.*)$ /? [R=301,L] -
Right .. sorry:
~img/head/beauty-spa.jpg%22%20width=%22114%22%20height=%2250%22%20alt=%22image%22/%3E%3C/a%3E%20%3C/div%3E%20%3Cdiv%20class=%22c0%20r%22%3E%3Ca%20href=%22/m/imgres?q=short+holiday+treatments~
I am looking for something like that:
RewriteRule ^img/head/beauty-spa.jpg(.)$ / [R=301,L]
RewriteCond %{QUERY_STRING} ^q=short+holiday+treatments$
RewriteRule (.) /? [R=301,L]But it ain't work
-
the sample code you posted comes through as a whole code fragment with unpaired tags. If you post it between curly braces it should show up better here. Are you looking for the syntax of the regular expression for your case, or something else?
-
Hi Mike - I know this already ;-).
I am asking for that special case.
But thank you for your time.
-
Normally redirects are done in the .htaccess file of your site, using a RewriteRule. Something like this:
RewriteEngine on
RewriteRule ^old.html$ new.htmlGoogle it and you'll find more examples.
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
-
Redirect to http to https - Pros and Cons
Hi, I know its best practice to redirect a website from http to https, instead of having many entry point to your website. When a website has been running for a long time on http and https, what are the SEO Pros and Cons of implementing a redirect from Http to Https?
Technical SEO | | FreddyKgapza1 -
301 redirect syntax for htaccess
I'm working on some htaccess redirects for a few stray pages and have come across a few different varieties of 301s that are confusing me a bit....Most sources suggest: Redirect 301 /pageA.html http://www.site.com/pageB.html or using some combination of: RewriteRule + RewriteCond + RegEx I've also found examples of: RedirectPermanent /pageA.html http://www.site.com/pageB.html I'm confused because our current htaccess file has quite a few (working) redirects that look like this: Redirect permanent /pageA.html http://www.site.com/pageB.html This syntax seems to work, but I'm yet to find another Redirect permanent in the wild, only examples of Redirect 301 or RedirectPermanent Is there any difference between these? Would I benefit at all from replacing Redirect permanent with Redirect 301?
Technical SEO | | SamKlep1 -
Existing content & 301 redirects
Hi All, I will try to keep this to the point. One of our websites was hit by penguin for unnatural linking. We are building a new site (same business, different domain), but we would like to take some of the pages/content off the old website and use it on our new site. Is it just a case of copying each page onto our new site and 301 redirect the old URL? Or should I just be completely rewording/recreating the old content so it is unique? Any help on this would be great, but I am also open to alternate methods too. Thanks Lewis
Technical SEO | | SO_UK0 -
301 redirect chains
Hi everyone, I've had my site for a while now and have changed the structure a number of times. I'm confident my 301's work well and am not concerned about dead ends on my site. My question is, is there a way to find 301 redirect chains? i.e. can I export my link data from webmaster tools and run it through some software that tells me how many steps my 301's are taking to get to the final page? I don't know for sure that there are long 301 chains in my link structure, but I have a suspicion and it's very hard to check by going through them manually. Thanks in advance Will
Technical SEO | | madegood0 -
260k 301 redirects
Hello, I just found that some of the urls on my site have both ugly characters and some other things I'd like to fix (such as ---- into a single - ) After some local tests i've seen that If i leave some imperfections there will be 48k different urls on the other hand if the renaming procedure is strict i'll have around 260k out of 2.3M urls to be renamed. If I'm going to do this I'll create new canonicals meta tag and redirect old urls with 301 headers to the new location. The content will not change. My big doubt is SEO wise, I know that I'll have better urls, but aren't those too much redirects on a single day? what would you do if you wish to have shipshape urls and know some of these are crap? thanks
Technical SEO | | mylittlepwny0 -
Code for redirect
What is the code to redirect www.xyz.com/abc where abc is a folder to www.xyz.com/abc.html
Technical SEO | | seoug_20050 -
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 : http://www.geographics.com/Graduation-Stationery,-35%-OFF-Printable-Certificates-Blank-Gift-Certificates/c1353_1354_1359/index.html to http://www.geographics.com/Graduation-Stationery-Printable-Certificates-Blank-Gift-Certificates/c1353_1354_1359/index.html We do not know how to do this in httaccess. Can you please advise? Thanks a lot! Madlena
Technical SEO | | Madlena0 -
301 Redirects
Hello, I have a problem with my website. I have a page on my website http://www.ensorbuilding.com/page.php/aboutus but if i type in www.ensorbuilding.com/page.php/aboutus/f8e45e9d9df6140bb5a7ff1173e8d828 or www.ensorbuilding.com/page.php/aboutus/0f0eea5e9ab0a3e8d91fad8fc0d3ce9c it still displays the about us page. Google is seeing this as duplicate content so what I would want to do is 301 redirect anything after www.ensorbuilding.com/page.php/aboutus . How could I implement a 301 redirect in this way?
Technical SEO | | danielmckay70