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 to setup an iFrame to be indexed as the parent site
Hi, we are trying to move all of our website content from www.mysite.com to a subdomain (i.e. content.mysite.com), and make "www.mysite.com" nothing more than an iFrame displaying the content from content.mysite.com. We have about 10 pages linking from the home page, all indexed separately, so I understand we'll have to do this for every one of them. (www.mysite.com/contact will be an iframe containing the content from content.mysite.com/contact, and we'll need to do this for every page) How do we do this so Google continues to index the content hosted at content.mysite.com with the parent page in organic results (www.mysite.com). We want all users to enter the site through www.mysite.com or www.mysite.com/xxxxxx, which will contain no content except for iFrames pulling in content from content.mysite.com. Our fear is that google will start directing users directly to content.mysite.com, rather than continue feeding to www.mysite.com. If we use www1.mysite.com or www2.mysite.com as the location of the content, instead of say content.mysite.com, would these subdomain names work better for passing credit for the iFramed content to the parent page (www.mysite.com)? Thanks! SIDE NOTE: Before someone asks why we need to do this, the content on mysite.com ranks very well, but site has a huge bounce rate due to a poorly designed CMS serving the content. The CMS does not load the page in pieces (like most pages load), but instead presents the visitor with a 100% blank page while the page loads in the background for about 5-10 seconds, and then boom 100% of the page shows up. We've been back and forth with our CMS provider about doing something about this for 5 years now, and we have given up. We tested moving our adwords links to xyz.mysite.com, where users are immediately shown a loading indicator, with our site (www.mysite.com) behind it in an iFrame. The immediate result was resounding success... our bounce rate PLUMMETED, and the root domain www.mysite.com saw a huge boost in search results. Problem with this is our site still comes up in organic results as www.mysite.com, which does not have any kind of spinning disk loading indicator, and still has a very high bounce rate.
Technical SEO | | vezaus0 -
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 -
Blogger /blog Folder level redirect setup using .htaccess
We have a blog currently powered by the free blogger.com website. We have set it up as blog.example.com we wish to seti it up as example.com/blog how can we do this using .htaccess file? we understand how to update htacess, but we don't know what code we should enter to achieve what we want our website is hosted on Apache servers with plesk control panel
Technical SEO | | Direct_Ram0 -
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 -
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 -
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