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 indexed lightbox URLs?
Hello all, So I'm doing some technical SEO work on a client website and wanted to crowdsource some thoughts and suggestions. Without giving away the website name, here is the situation: The website has a dedicated /resources/ page. The bulk of the Resources are industry definitions, all encapsulated in colored boxes. When you click on the box, the definition opens in a lightbox with its own unique URL (Ex: /resources/?resource=augmented-reality). The information for these colored lightbox definitions is pulled from a normal resources page (Ex: /resources/augmented-reality/). Both of these URLs are indexed, leading to a lot of duplicate indexed content. How would you approach this? **Things to Consider: ** -Website is built on Wordpress with a custom theme.
Technical SEO | | Alces
-I have no idea how to even find settings for the lightbox (will be asking the client today).
-Right now my thought is to simply disallow the lightbox URL in robots.txt and hope Google will stop crawling and eventually drop from the index.
-I've considered adding the main resource page canonical to the lightbox URL, but it appears to be dynamically created and thus there is no place to access (outside of the FTP, I imagine?). I'm most rusty with stuff like this, so figured I'd appeal to the masses for some assistance. Thanks! -Brad0 -
301 Redirects in subfolders
Hi, we're making our site into a static site but I would like to transfer the Google juice. Most of the links and database exist on subfolders though. Could I simply do 301 redirects on the subfolders and retain the value or does it have to be on the full domain?
Technical SEO | | Therealmattyd0 -
Canonical redirects
Hello, I have a quick question: I use wordpress for my website. I have a plugin for translating the website in other languages. Thus, I have 2 versions of urls, one with /en, one without (original languale). This has been seen as duplicate content. I have been advised that the best to do is to use canonical redirect. Should I use it on the general header.php (the only header I can find in the CMS), or should I redirect each page singularly? I believe the second is the best way, but I can't find headers and txt documents for each page in my FTP. As well I have seen this post, in which is explained that canonical redirects can be done directly in the general header.php http://www.bin-co.com/blog/2009/02/avoid-duplicate-content-use-canonical-url-in-wordpress-fix-plugin/ Is it true? You have any suggestion?
Technical SEO | | socialengaged
Thanks! 🙂 Eugenio0 -
301 redirect + new website copy
Hi There, We are currently redeveloping our website and we're rewriting and optimising our many of our service pages. I think I may already know the answer but should we apply 301 redirects from our old services pages to the new versions? The content subject matter will be the same on the new versions, they will just be completely reworded. I would be interested to hear your views. Thanks, Stu
Technical SEO | | Stuart260 -
URL redirect question
Hi all, Just wondering whether anybody has experience of CMSs that do a double redirect and what affect that has on rankings. here's the example /page.htm is 301 redirected to /page.html which is 301 redirected to /page As Google has stated that 301 redirects pass on benefits to the new page, would a double redirect do the same? Looking forward to hearing your views.
Technical SEO | | A_Q0 -
301 Redirect Questions
I have a site I built on a wisiwig editing platform that will not allow a 301 redirect. The site has already been remade and I need to point it to another domain. To do the redirect, can I change it to another domain host that will allow a 301 or will that make me loose the authority of the site? I may not be able to move the content of the site. Please help.
Technical SEO | | photoseo10 -
Does redirect of domain alias help rankings?
Yes... It iz I again ;o) Here's one for you savy techies out there: So, I've got a primary domain which is live, optimized and running smooooth. And then I've got a couple of misspelled domains as well (17 to be exact). Will it have an effect if I 301 those misspelled domains? What's Best Practice for several domain aliases? Example.
Technical SEO | | nosuchagency
Primary domain: bryghusprojektet.dk
Alias domain 1: bryghusprojekt.dk (301 redirects to primary domain)
Alias domain 2: bryghus-projekt.dk (Hosting company infopage)
Alias domain 3: bryghus-projekter.dk (Not activated) Regards.1 -
Question about domain redirects
One of my clients has an odd domain redirect situation. See if you can get your head round this: Domain A is set-up as a domain alias of Domain B Entering domain A or domain B takes you to default.asp on domain B. The default.asp includes VB script to check the HTTP_HOST variable. It checks whether the main doman name for domain A is present in the HTTP_HOST and if so redirects it to domain A/sub-folder/index.htm. If not present it redirects to domain B/index.htm. In both cases the redirect uses a response.Redirect clause. I think what is trying to be achieved is to redirect requests to Domain A to a sub-folder of Domain B. It works but seems extremely convoluted. Can anyone see problems with this set-up? Will link juice be lost along the redirect paths?
Technical SEO | | bjalc20110