.htaccess 301 Redirect Help! Specific Redirects and Blanket Rule
-
Hi there,
I have the following domains:
OLD DOMAIN: domain1.co.uk
NEW DOMAIN: domain2.co.uk
I need to create a .htaccess file that 301 redirects specific, individual pages on domain1.co.uk to domain2.co.uk
I've searched for hours to try and find a solution, but I can't find anything that will do what I need.
The pages on domain1.co.uk are all kinds of filenames and extensions, but they will be redirected to a Wordpress website that has a clean folder structure.
Some example URL's to be redirected from the old website:
http://www.domain1.co.uk/charitypage.php?charity=357
http://www.domain1.co.uk/adopt.php
http://www.domain1.co.uk/register/?type=2
These will need to be redirected to the following URL types on the new domain:
http://www.domain2.co.uk/charities/
http://www.domain2.co.uk/adopt/
http://www.domain2.co.uk/register/
I would also like a blanket/catch-all redirect from anything else on www.domain1.co.uk to the homepage of www.domain2.co.uk if there isn't a specific individual redirect in place.
I'm literally tearing my hair out with this, so any help would be greatly appreciated!
Thanks
-
Hi Steve,
htaccess can be tricky! That link above is a good overview of the options. What you want in your case I think is to make sure that the specific individual page url rewrites are before the generic domain rewrite so they are triggered first and the generic redirect is only triggered if none of the individual page urls above it are hit.
-
I've found this as a good source in the past, not sure if you have already checked it out:
http://www.internetmarketingninjas.com/blog/search-engine-optimization/301-redirects/
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 url with parameter
I have a wiki (wiki 1) where many of the pages are well index in google. Because of a product change I had to create a new wiki (wiki 2) for the new version of my product. Now that most of my customers are using the new version of my product I like to redirect the user from wiki 1 to wiki 2. An example of a redirect could be from wiki1.website.com/how_to_build_kitchen to wiki2.website.com/how_to_build_kitchen. Because of a technical issue the url I redirect to, needs to have a parameter like "?" so the example will be wiki2.website.com/how_to_build_kitchen? Will the search engines see it as I have two pages with same content?
Intermediate & Advanced SEO | | Debitoor
wiki2.website.com/how_to_build_kitchen
and
wiki2.website.com/how_to_build_kitchen? And will the SEO juice from wiki1.website.com/how_to_build_kitchen be transfered to wiki2.website.com/how_to_build_kitchen?0 -
Help with https// redirects
Hey there
Intermediate & Advanced SEO | | Jay328
I have a client who just moved from a self hosted CMS to Adobe Catalyst (don't ask!)
The problem: Their url indexed with google is https://domain.com, Adobe Catalyst does not support third party SSL certificates or https domains. Now when people google them https://domain.com shows up in search, HOWEVER it does not have a trusted certificate and a pop up window blocks the site. They are a mortgage company so SSL is really not needed. What can I do to get google to recognize the site at http: vs. https? Would this be something in GWMT? Thanks!0 -
Help With This Page
This is page - http://www.kempruge.com/location/tampa/tampa-personal-injury-legal-attorneys/ - is the most important one to my business, and I can't seem to get it to rank higher. It has the second highest authority and links, second only to my homepage (though none are all that impressive) but it is just buried in the SERPs. Granted, I know Tampa Personal Injury Attorney is the hardest keyword for us to rank for, but there must be some way to improve this. I know getting high quality links is an appropriate answer, but I'm looking for anything I can do solely on my end to improve it. However, if anyone has some ways to make the page more linkable, I'm all ears! Please, if you have a second to take a look, I'd appreciate any and all feedback. Thanks, Ruben
Intermediate & Advanced SEO | | KempRugeLawGroup0 -
Can you redirect specific sub domain URLs?
ello! We host our PDFs, Images, CSS all in a sub domain. For the question, let's call this sub.cyto.com. I've noticed a particular PDF doing really well, infact it has gathered valuable external links from high authoritative sites. To top it off, it gets good visits. I've been going back and forth with our developers to move this PDF to a subfolder structure.
Intermediate & Advanced SEO | | Bio-RadAbs
For example: www.cyto.com/document/xxxx.pdf In my perspective, if I move this and set up a permanent redirect, then all the external links the PDF gathered, link juice and future visits will be attributed to the main website. Since the PDF is existing in the subdomain, I can't even track direct visits nor get the link juice. It appears in top position of Google as well. My developer says it is better to keep images, pdf, css in the subdomain. I see his point and an idea I have is to: convert the pdf to a webpage. Set up a 301 redirect from the existing subdomain to this webpage Upload the pdf with a new name and link to it from the webpage, so users can download if they choose to. This should give me the existing rank juice. However, my question is whether you can set up a 301 redirect for just a single subdomain URL to a folder structure URL? sub.cyto.com/xxx.pdf to www.cyto.com/document/xxxx.pdf?0 -
301 redirects within same domain
If I 301 redirects all urls from http://domain.com/folder/keyword to http://domain.com/folder/keyword.htm Are new urls likely to keep most of link juicy from source url and maintain the rankings in SERP?
Intermediate & Advanced SEO | | Bull1350 -
301 redirect with /? in URL
For a Wordpress site that has the ending / in the URL with a ? after it... how can you do a 301 redirect to strip off anything after the / For example how to take this URL domain.com/article-name/?utm_source=feedburner and 301 to this URL domain.com/article-name/ Thank you for the help
Intermediate & Advanced SEO | | COEDMediaGroup0 -
Redirection question
How would I redirect this URL: http://www.members.mysite.com/ to this URL: http://www.mysite.com/ ? I cant figure it out
Intermediate & Advanced SEO | | JohnPeters0 -
Modify .htaccess
Hi everybody, I need to modify the .htaccess in order to include a 301 redirect. But I am having some problems with this. I downloaded the file into my computer and then modified it with windows notepad, but when I upload it again to the server it is not working and turns down my website. Even if I do not change anything on it. So I guess there is a problem in the saving process. Any Idea or suggestion? Thanks, G.
Intermediate & Advanced SEO | | SilbertAd0