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

  • Home
  • SEARCH
  • 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 452853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:06:51+00:00 2026-05-12T22:06:51+00:00

I have a website where various parts parse request URLs by themselves and some

  • 0

I have a website where various parts parse request URLs by themselves and some don’t (e.g. a vBulletin forum). The .htaccess I have to send requests to the appropriates scripts is:

# wiki, shop, admin
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !(.*)\.js
RewriteRule ^wiki/(.*)$ w/index.php?title=$1 [PT,L,QSA]
RewriteRule ^wiki/*$ wiki/ [L,QSA]
RewriteRule ^shop/ /shop/shop.php [NC,L]
RewriteRule ^forum/admincp/pkr/ /forum/admincp/pkr/pkr.php [NC,L]

This doesn’t work as I expected. I forgot that the rewrite conditions are only applied to the first rule that follows them. The question is How can I apply those RewriteConditions to all those rules without having to copypaste them 4 times?


What goes wrong is this:

  • /shop/example is rewritten to /shop/shop.php
  • /shop/shop.php is then rewritten again to /shop/shop.php (read: we have an infinite loop). This would not happen if this condition was applied to that rewrite rule, because /shop/shop.php is an actual file:

    RewriteCond %{REQUEST_FILENAME} !-f

So yeah…

  • 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-12T22:06:51+00:00Added an answer on May 12, 2026 at 10:06 pm

    Invert the expression and attach it to a breaking rule:

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} (.*)\.js
    RewriteRule ^ - [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've various tables for storing comments of various parts of a website that have
I want to create a website with various users. The users can have different
I have a website that allows users to query for specific recipes using various
I have an email account that receives various requests to get free materials, for
I have a website, in this website I use various 3rd party PHP scripts,
On my website various php codes run from various programmers from whom I have
On my website I have various containers with content <div> s text in them.
I have several asp.net website projects for various sites. Currently I want to add
For example, I have a website with various types of information. If that goes
I have website, usually all looks fine but sometimes one div is on the

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.