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 6470735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:08:40+00:00 2026-05-25T06:08:40+00:00

my htaccess file is that: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}

  • 0

my htaccess file is that:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI}  .*
RewriteCond %{QUERY_STRING} .* [NC]
RewriteRule .*\.php cms/index.php?request=$0&%{QUERY_STRING} [L]
RewriteRule ^(?:(?!website).).*\.(?:(?!php).)+$ cms/website/$0 [L]
RewriteRule ^[^./]*(\/[^./]*)*$ cms/index.php?dirs=$0 [L]

for example there is a file in uploads/aa.png, and if I request http://example.com/uploads/aa.png, it still redirect http://example.com/website/uploads/aa.png.

shortly, if there is file at the url requested it still redirect “cms/website”, how can I disable that?

  • 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-05-25T06:08:41+00:00Added an answer on May 25, 2026 at 6:08 am

    The RewriteCond directive only applies to the next RewriteRule. (Only one.)

    So your rewrite conditions apply only to your first RewriteRule. The other rewrite rules are unconditional.

    You have to repeat the RewriteCond’s for each RewriteRule, or set an environment variable:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .? - [E=FILE_EXISTS:1]
    
    RewriteCond %{ENV:FILE_EXISTS] !=1
    RewriteRule .*\.php cms/index.php?request=$0&%{QUERY_STRING} [L]
    
    RewriteCond %{ENV:FILE_EXISTS] !=1
    RewriteRule ^(?:(?!website).).*\.(?:(?!php).)+$ cms/website/$0 [L]
    
    RewriteCond %{ENV:FILE_EXISTS] !=1
    RewriteRule ^[^./]*(\/[^./]*)*$ cms/index.php?dirs=$0 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current .htaccess file contains the following lines: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule
I want something to put in my .htaccess file that will hide the .php
In my .htaccess file I have defined following rule, RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA] The
I am using this htaccess file. Everything is working fine except that first RewriteRule.
I have the following code in my htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} !^www.example.com$
I have application in subfolder http://example.com/some/other/sub/folder/ . And .htaccess file: RewriteEngine on RewriteBase /some/other/sub/folder
I am struggling with a very basic regex problem in my .htaccess file that
I am working on a host that blocks my .htaccess file from being used
I have created an .htaccess files that will prevent anyone from accessing a file
In my .htaccess file I have a set of rules as follows: RewriteRule ^dir/page1$

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.