Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Hosting Isapi_Rewrite Vesion 3 examples (Isapi Rewrite)

  1. #11
    Join Date
    Aug 2009
    Posts
    60

    Default

    Acemonroe,
    You can use code similar to the code below.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/folder(\/)?
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.
    RewriteRule ^(.*)$ folder/$1 [L]

    You would replace "folder" with the name of your folder, and replace domain, with the name of your domain.

  2. #12
    acemonroe Guest

    Default henger effect

    still no success doing this.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/NewFolder(\/)?
    RewriteCond %{HTTP_HOST} ^(www\.)?example.com\.
    RewriteRule ^(.*)$ folder/$1 [L]

    This isn't what I'm using but how I'm adding my info in. Does the bottom line where it says "folder" get renamed?
    Also is there a time period before this takes effect?

  3. #13
    Join Date
    Jun 2009
    Posts
    35

    Default

    The following should redirect all requests for your domain to the /subfolder directory. You can update 'subfolder' to whatever folder to which you are wanting the requests to go:

    Code:
    RewriteEngine On
    
    # Exclude requests already going to /subfolder to avoid an infinite loop
    RewriteRule ^subfolder.*$ - [NC,L]
    
    # Rewrite normal requests to /subfolder
    RewriteRule ^(.*)$ /subfolder/$1 [L]

    David D.

  4. #14
    draymondkc Guest

    Default ISAPI newbie

    put...

    RewriteEngine on
    RewriteRule about.html index.cfm [I,O,R=301,L]

    in .htaccess
    but about.html is not redirecting. Not sure what I'm doing wrong.
    thanks!

  5. #15
    Join Date
    Jun 2009
    Posts
    35

    Default

    I tested the rewrite rule you gave and it worked correctly for me on a test site.

    Please submit a support ticket via our support page or by emailing [email protected]. We can then test this on your site and figure out what the issue is.

  6. #16
    Join Date
    Aug 2009
    Posts
    60

    Default

    Exclude specific files such as "css, jpg, gif" from your 301 redirect.

    Exclude files from 301 redirect

    **Note**
    Replace "css|jpg|gif" with the file types you need to be excluded.

    RewriteRule ^.+\.(?:css|jpg|gif)$ - [NC,L]

  7. #17
    Join Date
    May 2010
    Posts
    20

    Default

    How to set a non-www to www redirect while not affecting your shared SSL, if you have it enabled.

    Code:
    RewriteEngine on
    # handle non-www HTTPS redirects. Consecutive conditions are implicitly ANDed together.
    RewriteCond %{SERVER_PORT} ^443$
    RewriteCond  %{HTTP_HOST}  ^(?!www\.).*mywebsite\.com$
    RedirectRule ^/(.*)$ https://secure#.ezhostingserver.com/mywebsite-com/$1 [R=301]
    
    # All requests arriving to this point either use www for the hostname, or use 
    # HTTP for the protocol. 
    
    # handle non-www non-HTTPS redirects
    RewriteCond  %{HTTP_HOST}  ^(?!www\.).*mywebsite\.com$
    RedirectRule ^/(.*)$ http://www.mywebsite.com/$1 [R=301]
    Last edited by CalebC; November 6th, 2011 at 03:20 PM. Reason: typo

  8. #18

    Default

    Rewrite all requests for /joomlainstallation to the root level:

    RewriteRule ^joomlainstallation/(.*)$ /$1 [NC,R=301]
    Jon Cavanaugh
    ColdFusion Systems Analysts
    Director of Business Development
    Linux Hosting | Christian Hosting | Railo Hosting

  9. #19
    Join Date
    Jun 2012
    Posts
    1

    Default Can Anybody Help, i am getting this error

    Hi
    Can anybody help, i am getting this error

    Its giving me 400 Bad Request..
    I don't know how this url came in google index, actually its joining my home page and my product page with a space in between..
    like this
    http://www.mywebsite.com/ http://www.mywebsite.com/10014.htm
    and its giving me a 400 error

    I want this to be redirected 301 to my product page like this http://www.mywebsite.com/10014.htm

    Can anyone Help.

    Thanks

  10. #20
    Join Date
    Jun 2012
    Posts
    3

    Default Redirect old htm files to new php pages in WordPress

    Guys - I'm so hoping you can assist me. I took the basic Redirecting non-www version to www as a good place to start

    All I want to do after that is make old htm files redirect to the new WP pages

    I tried rewrite rules both with & without the full http:// path - and as you see below tried it with just the begging forward slash /

    I took the RewriteRules from the post :-

    RewriteRule index.htm index.asp [I,O,R=301,L]

    So below is my code and its not redirecting, any idea what I missed? Oh and I also tried adding the isapi Rewrite plugin to wp.

    RewriteEngine on

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


    RewriteRule statement2.htm /?page_id=35 [I,O,R=301,L]
    RewriteRule fairs.htm ?page_id=11 [I,O,R=301,L]
    RewriteRule galleries.htm ?page_id=63 [I,O,R=301,L]
    RewriteRule recipes.htm ?page_id=41 [I,O,R=301,L]

Tags for this Thread

Posting Permissions

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