Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9216059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:20:15+00:00 2026-06-18T02:20:15+00:00

Most of my htaccess rules redirects unsigned users to index.html . But when I

  • 0

Most of my htaccess rules redirects unsigned users to index.html.
But when I redirect them to index.html, all of these rules are re-run for that page also. I need to run a minimum set of rules for the users visiting index file.

It’s obvious that [L] stops htaccess rules’ running.

What would be the better way for this issue? Is this a proper way to do it or do you have any better recommendations?

RewriteCond %{REQUEST_URI} index\.html
RewriteRule ^(.*)$ index.html [L]

My full htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} (\/onefolder|\/secondfolder) [NC]
    RewriteCond %{REMOTE_ADDR} !111\.22\.33\.44 [NC]
    RewriteCond %{REQUEST_URI} !(index\.html) [NC]
    RewriteRule ^(.*)$ index.html [F]

    RewriteCond %{HTTP_USER_AGENT} oneagent|otheragent [NC]
    RewriteCond %{REQUEST_URI} !(index\.html) [NC]
    RewriteRule ^(.*)$ index.html? [R=301,L]

    RewriteCond %{HTTP_USER_AGENT} betteragent|otherbetterganet [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(index\.html) [NC]
    RewriteRule ^(.*)$ index.html? [R=301,L]

    RewriteCond %{HTTP_COOKIE} !username [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(\/importantone|\/somefolder|index\.html) [NC]
    RewriteRule ^(.*)$ index.html [L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:20:16+00:00Added an answer on June 18, 2026 at 2:20 am

    A few things you can do. If you want to simply stop rewriting for index.html, you can do something similar to what you have (but simpler), at the very top of your rules:

    RewriteRule ^/?index.html$ - [L]
    

    The - is simply to “pass through”, essentially making it so rewriting stops there.

    Alternatively, you can prevent looping completely by adding this to the top of your rules:

    RewriteCond %{ENV:REDIRECT_STATUS} 200
    RewriteRule ^ - [L]
    

    Does something similar but checks if there was an internal redirect of any kind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .htaccess RewriteRule that redirects users to /coming_soon/ if they do not
I'm using a standard htaccess ErrorDocument 404 to redirect users to a new page.
I'm trying to get my htaccess rewrite rules to remove the index.php from the
Using .htaccess, I'd like to redirect files that do not exist to a controller
I am truly trying to accomplish the most simple thing... Redirect: http_://somehost/.../site_directory/Arg1/Arg2 To: http_://somehost/.../site_directory/index.php?a=Arg1&b=Arg2
I've following rules in .htaccess Options +FollowSymlinks RewriteEngine on DirectoryIndex index.php RewriteCond %{ENV:REDIRECT_STATUS} 200
Most of us write conditionals like: if (resultIndex == 0) ...but occaisionally I come
I have the following htaccess file, which hides the php extension and forces all
I know there are a lot of questions on here about this, but most
I've got an HTACCESS which contols HTTPS/HTTP redirection based on url, most of it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.