SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2013
    Location
    Gurgaon,India
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up non www to www redirection does not work successfully on subforlder

    Hi, I am able to redirect non www to www in web.config for IIS7 but my blog is redirecting on root/domain. Please help!

    Please find the code as below:

    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="Redirect seotraininginstitute.in to WWW" stopProcessing="true">
    <match url=".*" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^seotraininginstitute\.in$" />
    <add input="{PATH_INFO}" pattern="^/blog/" negate="true"/>
    </conditions>
    <action type="Redirect" url="http://www.seotraininginstitute.in/" redirectType="Permanent" />
    </rule>
    <rule name="redirect index.html" stopProcessing="true">
    <match url="^(\w*/)?index\.html" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="seotraininginstitute\.in$" />
    </conditions>
    <action type="Redirect" url="http://www.seotraininginstitute.in/{R:1}" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,645
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    96,

    Argh! Your best bet would be to wait for Wyatt (wwb_99) as he's the M$ expert.

    That said, I would question your syntax in the second rule as I suspect that you may need your {word character}* embedded in a character range definition (square brackets). Yes, that's Apache but I don't know how this version of IIS requires character range definitions to be entered.

    Sorry I don't speak IIS for you but this may help you find what you're looking for..

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •