Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Hosting Isapi_Rewrite Vesion 3 examples (Isapi Rewrite)

  1. #21
    Join Date
    Jun 2009
    Posts
    35

    Default RE: Can Anybody Help, i am getting this error

    Quote Originally Posted by usef4u View Post
    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

    The following rule should perform the appropriate redirect and fix any similar urls as well:

    RewriteRule http://www\.mywebsite\.com(.*)$ $1 [NC,R=301]

    NOTES:
    The 'NC' flag means 'No Case', making the regular expression case-insensitive.
    The 'R' flag causes ISAPI_Rewrite to redirect rather than rewrite the URL internally with the option of also setting the http status code to use.
    Last edited by davidd; June 6th, 2012 at 10:46 AM.

  2. #22
    Join Date
    Jun 2009
    Posts
    35

    Post RE: Redirect old htm files to new php pages in WordPress

    Quote Originally Posted by JanetEdkins View Post
    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]

    I tested the rewrite rules you posted, and they worked successfully on my test site. If you are on a Windows 2008 server, WordPress may have some IIS rewrite rules within the web.config file that could be interfering with ISAPI_Rewrite. I would check the contents of the web.config file if one exists to see if that may be the case. If it is, you will need to integrate all of the rewrite rules into a single file, either the .htaccess file (ISAPI_Rewrite) or the web.config (IIS Rewrite Module).


    NOTE: It looks like the rules you copied were taken from some rules that had RewriteCompatibility2 turned on as many of the option flags are unnecessary. The following version is slightly more succinct:

    RewriteEngine on

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

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

  3. #23
    Join Date
    Jun 2012
    Posts
    3

    Default How long doe it take to work?

    Quote Originally Posted by davidd View Post
    I tested the rewrite rules you posted, and they worked successfully on my test site. If you are on a Windows 2008 server, WordPress may have some IIS rewrite rules within the web.config file that could be interfering with ISAPI_Rewrite. I would check the contents of the web.config file if one exists to see if that may be the case. If it is, you will need to integrate all of the rewrite rules into a single file, either the .htaccess file (ISAPI_Rewrite) or the web.config (IIS Rewrite Module).


    NOTE: It looks like the rules you copied were taken from some rules that had RewriteCompatibility2 turned on as many of the option flags are unnecessary. The following version is slightly more succinct:

    RewriteEngine on

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

    RewriteRule statement2.htm /?page_id=35 [NC,R=301]
    RewriteRule fairs.htm ?page_id=379 [NC,R=301]
    RewriteRule galleries.htm ?page_id=304 [NC,R=301]
    RewriteRule recipes.htm ?page_id=41 [NC,R=301]
    Thanks David for the info. I updated my .htaccess but am still seeing the old pages. Does this take time to propagate on the server or should it be immediate?

    Also, I noticed line one of the page redirects has a back slash and the others don't so I've tried it both ways!

  4. #24
    Join Date
    Aug 2009
    Posts
    60

    Default

    JanetEdkins,

    Please try clearing the cache within your browser to be sure that you are not accessing a cached page, clearing the cache will force the browser to regather all of the information from the server.

  5. #25
    Join Date
    Jun 2012
    Posts
    3

    Default html redirects to WP

    Thanks Chris - should have said I'd already tried that - and I've tried other browsers that are not my regular one.

    site is www.inthestixstudio.com - I am seeing it as it should be = new WP site build, but client says some of her customers are reporting they are still seeing the old site. I have now changed all the old pages to show a link to the new equivalent page but I would like the redirect to work if at all possible. Do you have any suggestions for me?

    Tanks for your help. Oh and from a previous post, if I need to know, how can I find out what version of Windows Hostek are using to host this domain. Thanks again J

  6. #26
    Join Date
    Aug 2009
    Posts
    60

    Default

    JanetEdkins

    I have created a ticket for your specific issue and am replying directly to the email address on file with the information you requested as well as resolution for your customers.

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
  •