Best & easiest way to 301 redirect on IIS
-
Hi all,
What is the best and easiest way to 301 redirect URLs on IIS server?
I got access to the FTP and WordPress back office, but no access to the server admin.
Is there an easy way to create 301 redirect without having to always annoy the tech in charge of the server?
Thanks!
-
Thanks a lot for your answer
-
You have two options:
- Set it up in IIS Manager (best option, least overhead for the server, need no coding skills)
- Code it in classic ASP in a global include file that all pages reference before sending content back to the browser.
Here's a great article that walks you through the IIS config option. For this, you need access to IIS Manager:
Sounds like that option is unavailable to you however.
For the other option: your site probably has a file or two that's included at the start of all web pages. (If not, you can add it). In that file, you'll want to check the URL passed in like this:
Dim sThisPage = Request.ServerVariables("SCRIPT_NAME")
If (LCase(sThisPage) = "/oldpage.aspx") Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://" & sThisServer & "/newpage.aspx"
Response.End
End If -
Any IIS expert around?..
-
There - you can see how often I have worked on IIS servers
-
there is no .htaccess on IIS servers
-
No problem, I'll have a look for another website thanks
-
Nor was I.
If you have FTP access, you might then have to work in the .htaccess file and build the redirects in there.
-Andy
-
Bummer, I was not aware of that, its such an awesome plugin
-
Hi Vadim,
Thanks for your answer, however it looks that the redirection plugin works only for apache servers.
-
Hi Andy,
thanks, it works for IIS servers too?
- Benoit.
-
Hi Benoit,
Yes, Andy is totally on it. Server side redirects are faster, however if you have Wordpress a plugins make it so much easier and convenient.
Also if you want other powerful features like: 404 error monitoring - captures a log of 404 errors and allows you to easily map these to 301 redirects, and more Try Redirection plugin
Hope this Helps!
-
Absolutely - Install this plugin: http://wordpress.org/plugins/simple-301-redirects/
I use this on a couple of my own sites and it works a treat.
-Andy
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
-
What's the best way to integrate off site inventory?
I can't seem to make any progress with my car dealership client in rankings or traffic. I feel like I've narrowed out most of the common problems, the only other thing I can see is that all their inventory is on a subdomain using a dedicated auto dealership software. Any suggestion of a better way to handle this situation? Am I missing something obvious? The url is rcautomotive.com Thanks for your help!
Technical SEO | | GravitateOnline0 -
What is the best way to handle these duplicate page content errors?
MOZ reports these as duplicate page content errors and I'm not sure the best way to handle it. Home
Technical SEO | | ElykInnovation
http://myhjhome.com/
http://myhjhome.com/index.php Blog
http://myhjhome.com/blog/
http://myhjhome.com/blog/?author=1 Should I just create 301 redirects for these? 301 http://myhjhome.com/index.php to http://myhjhome.com/ ? 301 http://myhjhome.com/blog/?author=1 to http://myhjhome.com/ ? Or is there a better way to handle this type of duplicate page content errors? and0 -
301 vs 302 & Link Juice
Has any one come across any recent cases of a 302 link passing more link juice than before?
Technical SEO | | CeeC-Blogger0 -
Can I Get Penalized for 301 Redirects (Too Many or In Any Scenario)?
A client of ours owns several domain names that are keyword similar to the domain they actually use to run their site. They are asking us if we should 301 redirect all of these websites to the domain they use. However, I don't want this to work against them and their site get penalized later for this. I have heard buying out competitors and redirecting their domain to yours is frowned upon and penalized when you get caught (they did not do this). We are also wondering if there is a limit as to how many domains you can 301 redirect and what type (keyword similar, misspellings, .net's, etc.) and if you are penalized after too many (i.e. >50). All of the domains in question are keyword/brand name similar only and do not exist as actual websites. We just want to do the right thing. Thank you for your help.
Technical SEO | | JCunningham0 -
301 redirects & merging two sites into one
We have a client that has two sites that rank well for different searches in their market. The main pages ranking are things like advice articles and news pieces. For various reasons, they just want one site. I believe they need to duplicate the content from the outgoing site and place it on the main site, with a 301 redirect from each old page to each new one. What happens when they eventually want to redirect the entire domain? Would these smaller, internal redirects become obsolete, therefore removing any link value they once had? I am not sure how this works or if there is a best practice way to do this. Thanks Gareth
Technical SEO | | Gmorgan0 -
My home page 301 redirects - is this an SEO problem
When ever a browser calls my site canineconcepts.co.uk, it is automatically 301 redirected to canineconcepts.co.uk/en I am not sure if I should be concerned about this from an SEO perspective or not. Any thoughts?
Technical SEO | | CanineConcepts0 -
IIS Work Around 301 Redirects
We are redirecting page-level content (about 500 pages) from several sub domains to our main site. With IIS, It’s my understanding that file locations must match. For example: subdomain/pathA/filename1
Technical SEO | | DigitalMkt
mainsite/pathA/filename1 Since the sub domain files are not on the main site, this means we'd create up to 500 zero byte dummy files on the new server and replicate the sub domain directory structure. With IIS is there a work around for handling page level redirects without duplicating the file location? In the case of white papers, videos and case studies, we'll imlement directory level redirection. Thanks in advance.0 -
How do I redirect non-www to www in IIS?
There is a lot of talk about this all over this site (and other's), but just about every solution mentions using the .htaccess file, which is only a solution for Apache. My sites are in a shared windows environment, so that won't work for me. I have access to the IIS manager for the server, and have several page-level redirects in place. My issue is that I cannot find a clear and easy way to re-direct my root (domain.com) domain, to my preferred specific domain (www.domain.com). I found a few articles online relating to a URL re-write module for IIS, but am not sure if I will be able to install that on a shared web server. Is there another way to accomplish my goal of not having 2 indexable versions of my site? I have rel-canonical tags on every page, but would prefer a more trustworthy and established solution. Thanks for any help you can offer. -Dave
Technical SEO | | dschapira0