.htaccess expert needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HQ
    Confirmed User
    • Jan 2001
    • 3539

    #1

    .htaccess expert needed

    .htaccess expert needed for an interesting problem. (and i know i already posted this in the webmaster forum, but this forum is so much more helpful.)

    I'm getting an infinite loop happening in my .htaccess redirection. Is there anyway to 'turn off' the redirect when the html file being loaded *is* where the browser is being redirected to?
  • kevin197
    Registered User
    • Sep 2002
    • 18

    #2
    post your code please

    Comment

    • HQ
      Confirmed User
      • Jan 2001
      • 3539

      #3
      Here it is:

      RewriteEngine On
      RewriteCond %{HTTP_REFERER} .*substring.* [NC]
      RewriteRule /* http://www.freegallery.biz/index2.html [R,L]

      So whenever a referrer has "substring" in it, it forwards it to my entrance page, http://www.freegallery.biz/index2.html, instead of my main page, http://www.freegallery.biz/. The problem is that when index2.html is requested, the referrer still matches the substring and causes an infinite loop.
      Last edited by HQ; 09-10-2002, 03:50 PM.

      Comment

      • salsbury
        Confirmed User
        • Feb 2002
        • 1070

        #4
        RewriteCond %{REQUEST_URI} !^/index3.html

        ought to do it, before the RewriteRule?

        edited out the [NC] - it is unnecessary
        Last edited by salsbury; 09-10-2002, 03:13 PM.

        Comment

        • HQ
          Confirmed User
          • Jan 2001
          • 3539

          #5
          Originally posted by salsbury
          RewriteCond %{REQUEST_URI} !^/index3.html

          ought to do it, before the RewriteRule?

          edited out the [NC] - it is unnecessary
          I don't see how that will work. Where do I put in my substring comparison? And why is [NC] unnecessary?

          Comment

          Working...