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
-
Our site recently switched from http to https. Do I still need to setup a redirect for the incoming links pointing to http?
Our site recently switched from http to https. If you type in the http://www.websitename.com then it will automatically go to https://www.websitename.com ... my question is... do I still need to create a redirect in the htaccess file to ensure we don't lose all the links currently pointing to the http version of the website?
Technical SEO | | ninel_P0 -
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 -
How should we setup of a side (slightly off-topic) blog?
Our web application targets small business owners and entrepreneurs. However, the developers at our company have a lot of great content to offer the web development community and so we want to start a "behind the scenes" blog where we can discuss technical topics... JavaScript performance, web accessibility, etc. Our customers and the visitors of our website would probably not be interested this new content... So we want to be careful not to cannibalize or damage our current SEO. What are some of the major risks we should watch out for? If we put it on a subdomain, is that enough to not impact our main site SEO or introduce keyword confusion? Conversely, are there opportunities for this side blog to help the SEO and authority of our main website/domain? Thanks for the help!
Technical SEO | | Bill4Time0 -
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 -
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 -
Best way to setup large site for multi language
Hello, I am setting up a new site which is going to be very large, over 250,000 products. Most of our customers are in the UK (45%), the rest are from various European countries and the USA. Unfortunately we only have a team of two people writing content for these pages in English. I would value some input on the best way to setup my website structure for ranking. Obviously the best would be individual country oriented domains I.e. domain.fr domain.de domain.co.uk . However we wouldnt have the time to create content for every page and most pages would contain the same content as the English domain. Would I get a penalty for this from google? The second choice is to follow the example of overstock.com and pull in information relating to each country I.e. currency and delivery time. this would be a lot easier but I am concerned that the lack of geo focus would effect my rankings. Does any one have any ideas?
Technical SEO | | DavidLenehan0 -
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