301 redirect home page

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 14 Jun 2012, 20:15

301 redirect home page

14 Jun 2012, 20:20

Hey there,

Currently, the home page for the site is duplicating and available through “http://domain.com” “http://domain.com/default.aspx” and “http://domain.com/default.html” - can 301 redirects be put into place to minimize this? Similarly, I believe that redirects need to be in place so that “http://www.domain.com” and “http://domain.com” do not appear to be two different pages.

Is this possible? Our current rules are:


Code: Select all
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.87


RewriteEngine on
RewriteBase /
RewriteMap lower int:tolower
RewriteMap mapfileDrugs txt:maps\mapfiledrugs.txt
RewriteMap mapfileStories txt:maps\mapfilestories.txt
RewriteMap mapfileNews txt:maps\mapfilenews.txt
RewriteMap mapfileQuotes txt:maps\mapfilequotes.txt
RewriteMap mapfileParas txt:maps\mapfileparas.txt
RewriteMap mapfileResources txt:maps\mapfileresources.txt
RewriteMap mapfile txt:maps\mapfile.txt

RewriteCond %{REQUEST_METHOD} ^POST$ [NC]
RewriteRule . - [NS]

RewriteRule ^([^?/]+)/default.aspx content/default.aspx [L,NC,QSA]
RewriteRule ^content/([^?/]+)\.html content/default.aspx?pud=${mapfile:${lower:$1}} [L,NC,QSA]
RewriteRule default.html default.aspx?pud=3d0dd760-a5a0-4ba9-bead-04b298d5e766 [L,NC,QSA]
RewriteRule ^drugs/([^?/]+)\.html content/drugs.aspx?duid=${mapfileDrugs:${lower:$1}}&pud=c81a3533-60a3-494c-ab55-20df77a93e61 [L,NC,QSA]
RewriteRule ^stories/([^?/]+)\.html content/story.aspx?suid=${mapfileStories:${lower:$1}}&pud=1a353ae1-6008-40d4-b2e3-c98e8b1f704c [L,NC,QSA]
RewriteRule ^news/([^?/]+)\.html content/news.aspx?nwuid=${mapfileNews:${lower:$1}}&pud=57f7242d-2a43-43f3-8bf2-ca9bd1ecd87c [L,NC,QSA]
RewriteRule ^quotes/([^?/]+)\.html content/quote.aspx?quid=${mapfileQuotes:${lower:$1}}&pud=97ff0393-c173-4d2a-a208-46767bd22df9 [L,NC,QSA]
RewriteRule ^paraphernalia/([^?/]+)\.html content/para.aspx?pauid=${mapfileParas:${lower:$1}}&pud=3e7274c6-2c08-401d-ae49-74d39a884f30 [L,NC,QSA]
RewriteRule ^resources/([^?/]+)\.html content/resources.aspx?rsrcpd=${mapfileResources:${lower:$1}}&pud=3e0c6227-b432-4cec-b08d-be7022d162d5 [L,NC,QSA]
RewriteRule ^([^?/]+)/([^?/]+)\.html content/default.aspx?pud=${mapfile:${lower:$2}}&tbbd=${mapfile:${lower:$1}} [L,NC,QSA]


User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: 301 redirect home page

18 Jun 2012, 07:19

Hello,

Do you mean you would like to have all your content redirected from non-www to www? and also to avoid duplication for main page (making all pages point only at one e.g. to http://domain.com), correct?


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 7 guests