Webconfig setup
-
We're launching a new site for our client on their existing domain, and as many of the URL's are changing we need to create some webconfig redirects.
However, rather than create a webconfig file which redirects each page on the existing site to a corresponding page on the new site, I was hoping to create redirect rules for the top landing pages only, and then have a catch all which redirects all other URL's to the homepage.
How would you set this up in a webconfig file?
-
If you look at tutorials you can copy and paste module with all the hard work done. and then you onlyhave to write the redirects
-
Ok, thanks Alan. I'll nag the devs again.
-
Then i would look at created a ihhtpmoduel, not too hard, i have tutorials on my sites
-
An update on this...
I've tried to create a web.config file containing around 1000 redirects from the old version of an ecommerce site to the new version of the site.
They've kept the same domain, but the URL structure is completely different so really I need all the redirects I've pieced together to be put in place. However, the web.config is too big and breaks the site.
In the interim I'm going to cut down the web.config file until it works, but I this isn't an ideal solution.
Any ideas?
-
I did'nt recomend IHttpModule, although it is a very good way to do it. You can then do all your redirects by code rather then regular expressions, with code I find it easier to do more complicated stuff.
The redirecets you are doing are oldPage to newPage this is fine, but not the best. You may have a incomming link about dogs, that went to a page about cats, now is a chance to point it to dogs. Your links may not have been pointing at the most releative page so just going page to page brings accross any non relevant links. You can do betterbuy getting a link report from SEOMoz and looking at the refereing page and the link text to make the best decision. But with time and effort, it may be the easiest to do as you are doing.
Also using url-rewite model of IIS gives you more flexability than using the location tag as you are doing. You should install it on iis if you can and look at the options it gives you.
-
Thanks for the responses.
OK, so generally you'd try and have a specific redirect in place for all URL's on the existing site.
I understand then that I should create a more comprehensive set of redirects, but I'm unsure about the IHttpModule. What is the reason you've suggested this method as opposed to setting up redirects directly within the web.config using rules like this:
<location path="services.htm"></location>
Thanks again, Matt
-
I totally agree with Alan on this. You really need to look at each individual URL, and 301 redirect to ensure they are in place, page by page. It's a sensitve issue for sure and proceed with caution for sure.
It's also not condusive to 301 all URL's and links to the homepage URL. This doesn't make for a great 'user experience' and can cause confusion to the user visiting the site, looking for the specific material. It can also confuse the hell out of a search engine (where did all those other pages I had index'ed go!)
You might also damage the inbound link quality of pages in place now that have links pointing to it. Sure that would pass on to the main domain URL (losing value of 5-15% in the 301), but it's just not a great strategy tpo blindly 301 everything to the homepage. Alan said it right below - you need to look at the links, inbound anchor text, where it's coming from and redirect to the right page via 301) for the best user end experience.
I would map out all the URL's that are new, and then map out the URL's that correlate to those pages exactly. Then setup the webconfig file to have individual page level 301 redirects and put those into place. He provided a link below to his webconfig file for 301 redirects.
Cheers, Rob
-
I would not redirecet all to the home page, they will be ignored if you 301 redirecet onm mass to the one page.
You really do need to look at each link comming into the siite, look at the link text and the page it comes from and decide a good relevant page to send it to.
For some tutorials on redirecetd using teh webconfig file see my web 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
-
How do I setup sitemaps for an international website?
I am adding translated versions of my sites to a subdomain for example es.example.com. Will I add each subdomain into Google Webmaster Tools? Will each need its own sitemap?
Technical SEO | | EcommerceSite0 -
UK and US Targeting Simultaneously - Domain Setup and Duplicate Content?
I have a site that will be targeting the US and the UK. However, it will need to display slightly different content to the two. Should I use a .co.uk and a .com, or uk.themainsite.com for the UK, or themainsite.com/UK? This is of course setting up multiple country targeting within Google Webmaster Tools. Am I likely to run into duplicate content issues?
Technical SEO | | james4060 -
Wordpress initial setup
Hello I am going to create a new WP site. Basically, I would like to have your suggestions for the initial setup (checklist) in terms of SEO. For example: xml sitemap, robots.txt, .htaccess, permalinks, www or no www, etc Basically, I would like to start in the right way Any advise would be appreciate. Thank you so much Andy
Technical SEO | | newsmile0 -
Questions about root domain setup
Hi There, I'm a recent addition to SEOmoz and over the past few weeks I've been trying to figure things out. This whole SEO process has been a bit of a brain burner but its slowly becoming a little more clearer. For awhile I noticed that I was unable to get Open Site Explorer to display information about my site. It mentioned that that there was not enough data for the URL. Too recent of a site, no links, etc. Eventually I changed the the URL to include "www." and it pulled up results. I also noticed that a few of my page warnings are because of duplicate page content. One page will be listed as http://enbphotos.com. The other will be listed as http://www.enbphotos.com. I guess I'm not sure what this all means and how to change it. I'm also not really sure what the terminology even is and something regarding root domain seemed appropriate but I'm not sure if it is accurate. Any help/suggestions/links would be appreciated! Thanks, Chris
Technical SEO | | enbphotos0 -
How should I properly setup my .htaccess file?
I have searched google for 'how to setup .htaccess file' and it seems that every website has some variation. For example: RewriteCond %{HTTP_HOST} ^yoursite.com RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=permanent,L] On SEOMOZ someone posted this: RewriteCond %{HTTP_HOST} !^www.yoursite.com [NC] RewriteRule (.*) http://www.yoursite.com/$1 [L,R=301] On yet another website, I found this: RewriteEngine On RewriteCond %{HTTP_HOST} !^your-site.com$ [NC] RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301] As you can see there are slight differences. Which one do I use? I'm on Apache CentOS and I have HTML5 websites and several Joomla! wesites. Would the HTACCESS File be different for both?
Technical SEO | | maxduveen0 -
Mobile Domain Setup
Hi, If I want to serve a subset of pages on my mobile set from my desktop site or the content is significantly different, i.e. it is not one to one or pages are a summarised version of the desktop, should I use m.site.com or is it still better to use site.com? Many thanks any help appreciated.
Technical SEO | | MarkChambers0 -
Blog Setup
A client has been blogging for about a year on http://blog.abccompany.com/ and has a page authority of 37. With it's built up past history, should we change the blog to a subdirectory, http://www.abccompany.com/blog ? Obviously thinking what is the best long-term strategy / benefits. Thanks, Chris
Technical SEO | | evereffect0 -
How to setup tumblr blog.site.com to give juice to site.com
Is it possible to get a subdomain blog.site.com that is on tumblr to count toward site.com. I hoped I could point it in webmaster tools like we do www but alas no. Any help would be greatly appreciated.
Technical SEO | | oznappies0