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
-
301 Redirects from Subdomain to Location Pages
I have a client site that is getting redesigned. Its a multi location service provider. Currently (for whatever reason) the location pages are sub domains. https://<location-name>.site.com/ In the new design the locations will be on the main domain. https://site.com/locations/<location-name> We are considering using 301 redirects from the current sub domains to the new location pages on the main domain. The current sub domains are setup on a multi-site with A records for each one in our GoDaddy account. Would like to get feedback on any unforeseen SEO issues that anyone might have input on.
Technical SEO | | ColeBField12210 -
What is the best way to show content in Listing Pages?
If it is e-commerce site and a product listing page there is always a conflict how to show the content? As per my understanding we can show content in two different ways. 1. To show little content and use **Read more. (**In this case there is a direct message to the google: Here is the content visible and rest content is hidden but available for visitors to read more 2. Can use** Scroll bar**. So here is the message to Google and visitors that my full content is available here. So just scroll down to read further. So I want to know that which method of showing content is best and it's impact of SEO where there is UI constraint or both the method is ok without any SEO impact. Please share your suggestions. DCdRJpH
Technical SEO | | kathiravan0 -
301 Redirect Expert
I have hired two website people from odesk and had bad experience in 301 redirects. One never got it done and the other cause my website to crash on a 500 error code, he load all the redirects in a script on .htaccess on my wordpress site on godaddy, there were 1400 redirect.Can somebody recommend a expert for my redirect problem.
Technical SEO | | tjacquet0 -
Remove html file extension and 301 redirects
Hi Recently I ask for some work done on my website from a company, but I am not sure what they've done is right.
Technical SEO | | ulefos
What I wanted was html file extensions to be removed like
/ash-logs.html to /ash-logs
also the index.html to www.timports.co.uk
I have done a crawl diagnostics and have duplicate page content and 32 page title duplicates. This is so doing my head in please help This is what is in the .htaccess file <ifmodule pagespeed_module="">ModPagespeed on
ModPagespeedEnableFilters extend_cache,combine_css, collapse_whitespace,move_css_to_head, remove_comments</ifmodule> <ifmodule mod_headers.c="">Header set Connection keep-alive</ifmodule> <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews</ifmodule> DirectoryIndex index.html RewriteEngine On
# Rewrite valid requests on .html files RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^ %{REQUEST_URI}.html?rw=1 [L,QSA]
# Return 404 on direct requests against .html files RewriteCond %{REQUEST_URI} .html$
RewriteCond %{QUERY_STRING} !rw=1 [NC]
RewriteRule ^ - [R=404] AddCharset UTF-8 .html # <filesmatch “.(js|css|html|htm|php|xml|swf|flv|ashx)$”="">#SetOutputFilter DEFLATE #</filesmatch> <ifmodule mod_expires.c="">ExpiresActive On
ExpiresByType image/gif "access plus 1 years"
ExpiresByType image/jpeg "access plus 1 years"
ExpiresByType image/png "access plus 1 years"
ExpiresByType image/x-icon "access plus 1 years"
ExpiresByType image/jpg "access plus 1 years"
ExpiresByType text/css "access 1 years"
ExpiresByType text/x-javascript "access 1 years"
ExpiresByType application/javascript "access 1 years"
ExpiresByType image/x-icon "access 1 years"</ifmodule> <files 403.shtml="">order allow,deny allow from all</files> redirect 301 /PRODUCTS http://www.timports.co.uk/kiln-dried-logs
redirect 301 /kindling_firewood.html http://www.timports.co.uk/kindling-firewood.html
redirect 301 /about_us.html http://www.timports.co.uk/about-us.html
redirect 301 /log_delivery.html http://www.timports.co.uk/log-delivery.html redirect 301 /oak_boards_delivery.html http://www.timports.co.uk/oak-boards-delivery.html
redirect 301 /un_edged_oak_boards.html http://www.timports.co.uk/un-edged-oak-boards.html
redirect 301 /wholesale_logs.html http://www.timports.co.uk/wholesale-logs.html redirect 301 /privacy_policy.html http://www.timports.co.uk/privacy-policy.html redirect 301 /payment_failed.html http://www.timports.co.uk/payment-failed.html redirect 301 /payment_info.html http://www.timports.co.uk/payment-info.html1 -
301 redirect not working
Hi there! I have recently moved a domain that has been indexed by google and setup redirects so that it forwards to the new domain. It seems like the only redirect that actually is working is the canonical and main domain but every other page and or page nested within a folder are not working. Here is an example of some of the redirects. Am I doing this wrong? It seems to be going to the new domain but can't find the actual pages.... RewriteEngine On
Technical SEO | | twotd
RewriteBase /
RewriteCond %{HTTP_HOST} !agoodsweep.com$ [NC]
RewriteRule ^(.*)$ http://agoodsweep.com/$1 [L,R=301]
redirect 301 woodstoveservicerepair.html http://agoodsweep.com/woodstoveservicerepair/
redirect 301 /westchesterchimney.html http://agoodsweep.com/west-chester-chimney/ Thanks in advance for any help!!0 -
Index.php and 301 redirect with Joomla
Hi, I'm running Joomla 1.7 with SEF on and I'm trying to do a htaccess redirect which fails. I have approximately 100 in effect so far and all working fine, but I have one snag. Index.php is not working as I need it to when it's redirected to www.myurl.com/ If I turn on index.php redirect to root using this code #index.php to root
Technical SEO | | NaescentAdam
RewriteCond %{HTTP_HOST} ^myurl.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.myurl.com$
RewriteRule ^index.php$ "http://www.myurl.com/" [R=301,L] And then go to www.myurl.com/test.html I'm redirected to the homepage. I think this is because all pages are index.php in joomla. SEOMOZ and Google both think that index.php and root are duplicate pages. Does anyone have any advice for overcoming this? Thanks, Adam0 -
Removing 301 Redirects
Is it safe to remove old 301 Redirects from an SEO standpoint and can 301s dramatically affect seo? Prior to switching our old domain over to our new domain, we had (and currently still do) tons of 301 redirects, because of optimizing our file names and structure. Then our old domain was redirected to our new domain in the same redirect file. So that being said, now that our new domain has been up and running for about 3 months, would it be safe for me to get rid of the old 301 redirects and redirect anything that was on our old domain to our new domains home page? This would clean up our redirects tremendously and I hope would help with SEO.
Technical SEO | | hfranz0 -
301 redirect .htaccess problem
Can anyone explain to me why this doesn't work? Redirect 301 /category/diamond-pendants/nstart/1/start/(.*) http://www.povada.com/category/pendants/nstart/1/start/$1 Im trying to replace everything after /start/ and insert it into the new url. Thanks in advance.
Technical SEO | | 13375auc30