.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
-
I have multiple URLs that redirect to the same website. Is this an issue?
I have multiple URLs that all lead to the same website. Years ago they were purchased and were sitting dormant. Currently they are 301 redirects and each of the URLs feed to different areas of my website. Should I be worried about losing authority? And if so, is there a better way to do this?
Technical SEO | | undrdog990 -
SEO for Parallax Website
Hi, Are there any implications of having a parallax website and the URL not changing as you scroll down the page? So basically the whole site is under the same URL? However, when you click on the menu the URL does change? Cheers
Technical SEO | | National-Homebuyers0 -
Duplicate Version of My Website
Hello Again, Looking for a little help to help me understand what exactly is going on here. Ive taken over maintenance of a website and have so far fixed a lot of issues. ahrefs has shown me that a second version of my companies website exists that exists at a second url. This second website is linked to the actual company website like I haven't seen before. www(dot)#(dot)co(dot)uk is the main company website. But a second accessible version exists and is accessible at www(dot)#(dot)co(dot)uk The instruments version is a direct copy and all of the links point directly to my main site. Any changes I make on the main version are automatically applied to the other version. It shows up as a SPAM back link on moz as all of the link points to my website etc Ideally in my mind, the instruments version homepage should simply re-direct to the main homepage to solve this "duplicate content and spammy backlink" issue however, the instruments version is the same suffix that all our company emails work with. Basically, HELP lol. I have no understanding of how this is set up, and the best way in which to deal and if it could affect anything such as company emails.
Technical SEO | | ATP0 -
Meta Description Being Picked up from another site!?
Hi, when we search for a phrase (which is the most searched for phrase for our company) the meta description which is displayed isnt the one we set, and it hasnt picked it up from any text on the page. The description is incorrect, it says we have an office in a city that we dont, and it just isnt a very good description generally. What has been suggested to us by our website developers is that the description is being picked up by google from a website which lists companies details. The description which is displayed on that website, is the same as the description which is shown for our company in the search results. But is it possible for Google to ignore the meta description which is set in our homepage and the other text on the home page, and pickup the text from another website and use it as our description? Many Thanks
Technical SEO | | danieldunn100 -
What I doing wrong when trying to search for links from external websites to my website
This is just the little frustrating question nothing important but I’m sure somebody will know the answer. In the white board Friday this week Rand suggested at one point that when you’re searching for results links to your website if you put a - followed by site followed by your url like –site:yourwebsite.com you get the results of pages with links on other websites but excluding your own webpages but it just doesn’t work I get no results just an error message, any idea why? If I remove the - I get tons of results but there on my own webpages……….
Technical SEO | | whitbycottages0 -
Website redesign launch
Hello everyone, I am in the process of having my consulting website redesigned and have a question about how this may impact SEO. I will be using the same URL as I did before, just simply replacing an old website with a new website. Obviously the URL structure will change slightly since I am changing navigation names. Page titles will also change. Do I need to do anything special to ensure that all of the pages from the old website are redirected to the new website? For example, should I do a page level redirect for each page that remains the same? So that the old "services" page is pointed to the new "services" page? Or can I simply do a redirect at the index page level? Thank you in advance for any advice! Best, Linda
Technical SEO | | LindaSchumacher0 -
What are the pros and cons of moving one site onto a subdomain of another site?
Two sites. One has weaker sales. What would the benefits and problems for SEO of moving the weak site from its own domain to a subdomain of the stronger site?
Technical SEO | | GriffinHansen0 -
Merging two sites into one
I have two websites, www.joecline.com and www.affinityproperties.com. Originally, I wanted joecline.com to be focused on west austin only. I now realize that I only have time to really handle the promotion of one site. I'm wondering SEOwise, which url would be better to keep. I would consolidate all content on one site and 301 the migrated site to the new URLs in the domain which I would keep. Any ideas would be great. Thanks Joe
Technical SEO | | simplesimon0