.htaccess when integrating one website into another
-
My client would like to integrate one of it's smaller websites into its main website.
I've identified around 20 pages which I'd like to 301 redirect to specific pages on the main website, and this is simple enough.
The problem I have is that I am not sure how I can then put a catch-all to redirect all other pages on the site to the homepage of the main website.
I'd originally though something like this would work:
redirect 301 / http://www.mainwebsite.com/ (catch-all)
redirect 301 /about.asp http://www.mainwebsite.com/about (specific redirect 1)
redirect 301 /latest.asp http://www.mainwebsite.com/news (specific redirect 1)
etc.Any ideas?
-
Just had a eureka moment with the issue as above!
All that was needed was a .htaccess on the old site like this:
Redirect 301 / http://www.newsite.com/
This attempts to pass a user/crawler to the equivalent page on the new site (which doesn't exist), so this is then handled with a .htaccess on the new site which then redirects to the new versions of those pages:
Redirect 301 /about.asp http://www.newwebsite.com/about (specific redirect 1) Redirect 301 /latest.asp http://www.newwebsite.com/news (specific redirect 1)
Simples!
-
You should be able to achieve what you want by redirecting 404s. You can do this by adding the following to your .htaccess
ErrorDocument 404 /homepage.html
Where homepage.html is the address of your homepage.
What would be better really though is to land them on a an actual 404 page that explains that the page doesn't exist anymore and gives them options of where to go next. Include direct links to the most popular content on the site.
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
-
Will putting a one page site up for all other countries stop Googlebot from crawling my UK website?
I have a client that only wants UK users to be able to purchase from the UK site. Currently, there are customers from the US and other countries purchasing from the UK site. They want to have a single webpage that is displayed to users trying to access the UK site that are outside the UK. This is fine but what impact would this have on Google bots trying to crawl the UK website? I have scoured the web for an answer but can't find one. Any help will be greatly appreciated. Thanks 🙂
Technical SEO | | lbagley0 -
E-commerce website
Hi, I have to do a SEO optimization on a huge e-commerce website, but i don´t know if i have to focus in Schema or meta tags ( page title, meta description) which of them is more important? how can I optimize the website? Thanks
Technical SEO | | AbacoDigital1 -
Google not crawling the website from 22nd October
Hi, This is Suresh. I made changes to my website and I see that google is unable to crawl my website from 22nd October. Even it is not showing any content when I use Cache:www.vonexpy.com. Can any body help me in knowing why Google is unable to crawl my website. Is there any technical issue with the website? Website is www.vonexpy.com Thanks in advance.
Technical SEO | | sureshchowdary1 -
Website cache?
Hi mozzers, I am conducting an audit and was looking at the cache version of it. The homepage is fine but all the other pages, I get a Google 404. I don't think this is normal. Can someone tell me more what could be the issue here? thanks
Technical SEO | | Ideas-Money-Art0 -
Removing indexed website
I had a .in TLD version of my .com website floated for about 15 days, which was a duplicate copy of .com website. I did not wish to use the .in further for SEO duplication reasons and had let the .in domain expire on 26th April. But still now when I search from my website the .in version also shows up in results and even in google webmaster it shows the the website with maximum (190) number of links to my .com website. I am sure this is hurting the ranking of my .com website. How can the .in website be removed from googles indexing and search results. Given that is has expired also. thanks
Technical SEO | | geekwik0 -
Mobile website settings - I am doing right?
Hi, http://www.schicksal.com has a "normal" and a "mobile' version. We are using a browser detection routine to redirect the visitor to the "default site" or the "mobile site". The mobile site is here:
Technical SEO | | GeorgFranz
http://www.schicksal.com/m The robots.txt contains these lines: User-agent: *
Allow: / User-agent: Googlebot
Disallow: /m
Allow: / User-agent: Googlebot-Mobile
Disallow: /
Allow: /m Sitemap: http://www.schicksal.com/sitemaps/index So, the idea is: Only allow the Googlebot-Mobile Bot to access the mobile site. We have also separate sitemaps for default and mobile version. One of the mobile sitemap is here My problem: Webmaster tool is saying that Google received 898 urls from the mobile sitemap, but none has been indexed. (Google has indexed 550 from the "web sitemap".) I've checked the webmaster tools - no errors on the sitemap. So, if you are searching at google.com/m - you are getting results from the default web page, but not the mobile version. This is not that bad because you will be redirected to the mobile version. So, my question: Is this the "normal" behaviour? Or is there something wrong with my config? Would it be better to move the mobile site to a subdomain like m.schicksal.com? Best wishes, Georg.0 -
Links into website that are unnatural - a paid article
I prepared an article for another related website and posted it on my website - http://www.gardenbeet.com/garden_design_blog/garden-ideas/save-money-and-create-diversity-seeds-and-small-plants-are-better/ I was paid to write an article and provided a link to the related website at the end of the article - I declared the payment a good 10 months later the page where the article sits has become the 2nd most linked to page on my website - SEOmoz is giving it a Page Authority of 48 and all the links are coming from a wide variety of forums using one anchor text link phrase in the latest google update my homepage PR dropped by 1 - I am assuming the penalty came because of this article is it worth changing the URL to remove these spammy links to my website?
Technical SEO | | GardenBeet0 -
Two company websites - should 1 be nofollow?
We are an automotive dealership that is required to keep a manufacturer appointed website. It's pretty terrible so we are having a new site developed in addition to that. We plan on transferring our current domain name to the new site but I am not sure what to do with the older, less useful site. Should I try to have both sites appear in the search results to capture more traffic? Or is that inefficient? Should I make the new site no follow?
Technical SEO | | kylesuss0