Results 1 to 5 of 5

Thread: Asapi redirect

  1. #1
    Join Date
    Dec 2010
    Posts
    54

    Asapi redirect

    Hi i don know if i am posting to the right thread.

    I want to make a 301 redirect from test.gr to www.test.gr

    I have IIS 7 and as i saw in the icons i have the Asapi filter

    I have read about asapi but i have not managed to make the redirection to work .


    I have created a httpd.ini file and put it in the folder that i have my domain site. Inside httpd file i wrote that
    [ISAPI_Rewrite]
    RewriteCond Host: ^test\.com
    RewriteRule (.*) http\://www\.test\.com$1 [I,RP]

    Is that correct as procedure and the code is ok??

    Can you please guide me.

    Thanks

  2. #2
    Have you tried this out:
    RewriteCond %{HTTPS} (on)?
    RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
    RewriteCond %{REQUEST_URI} (.+)
    RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
    I normally just use this in htaccess:
    RewriteCond %{HTTP_HOST} ^test.com [NC]
    RewriteRule ^(.*)$ http://www.test.com/$1 [L,R=301]

  3. #3
    Join Date
    Dec 2010
    Posts
    54
    First i want to know that if i put a file httpd.ini in the root folder of my site the ASAPI will work.

    Second the file i create is for asapi that i have never before used so i need some help because despite i use a code i found in net it does not work
    [ISAPI_Rewrite]
    RewriteCond Host: ^test\.com
    RewriteRule (.*) http\://www\.test\.com$1 [I,RP]

    Thanks

  4. #4
    Join Date
    Feb 2011
    Location
    Denver, CO
    Posts
    124
    Are you sure it is ISAPI_Rewrite and not URL Rewrite? If it is URL rewrite, you can create a rule through the module in IIS mmc, or you can add it to your web.config.

    Either way, here is a rule for both.

    ISAPI_Rewrite - also, if this is the lite version, you have to add it to httpd.ini in the program folders file, check their documentation.

    RewriteEngine on

    RewriteCond %{HTTPS} (on)?
    RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
    RewriteCond %{REQUEST_URI} (.+)
    RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

    URL Rewrite
    <rule name="CanonicalHostNameRule1">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^www\.test\.gr$" negate="true" />
    </conditions>
    <action type="Redirect" url="http://www.test.gr/{R:1}" />
    </rule>

  5. #5
    Join Date
    Dec 2010
    Posts
    54
    No iam not sure is an Isapi_rewrite

    In IIS i see that when i click mytest_site.com one of icos says "ISAPI Filters" and i asked my host how to do 301 redirect and they told me to use isapi

    Is there somewhere else to check if Isapi_rewrite working ??
    How can i check its version ?

    the httpd in program folders file ? Where is this folder ??
    I tried to put it in the destination folder of the site

    Sorry but i had seen the documentation but i have not fingured this out, that is why i have posted here

    Thanks again !

Similar Threads

  1. ASAPI filter for IIS hotlink protection
    By Wheemer in forum Hosting Security and Technology
    Replies: 2
    Last Post: 11-23-2005, 07:16 AM
  2. IP Redirect / Country Redirect.
    By alma714 in forum Web Hosting
    Replies: 1
    Last Post: 12-25-2004, 03:19 PM
  3. Redirect -
    By dai_hiep in forum Hosting Security and Technology
    Replies: 3
    Last Post: 08-28-2004, 03:15 AM
  4. Best Way to Redirect...
    By NVB in forum Dedicated Server
    Replies: 3
    Last Post: 09-04-2001, 01:58 PM

Posting Permissions

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