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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:39:17+00:00 2026-05-13T05:39:17+00:00

If i use: RewriteEngine On RewriteRule ^.* controller.php It would send all requests to

  • 0

If i use:

RewriteEngine On
RewriteRule ^.* controller.php

It would send all requests to controller.php
But if controller.php included a css file (/assets/css/main.css) then it wouldn’t work, as when the browser called it, it would just redirect to controller.php

Is there a way i can fix this?

  • 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-13T05:39:17+00:00Added an answer on May 13, 2026 at 5:39 am

    You could add a condition to exclude URLs that can be mapped to actually existing files:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^.* controller.php
    

    The -f keyword will test if the absolute path in %{REQUEST_FILENAME} is a path to an existing regular file in the filesystem and !-f is just the inverse.

    But if you have a fixed list of directories you want to exclude, you could also do this:

    RewriteCond $0 !^(assets|foo|bar)/
    RewriteRule ^.* controller.php
    

    This condition tests if the match of the whole RewriteRule pattern (referenced with $0) does not begin with neither assets/ nor foo/ nor bar/. If you don’t want to process the match you could also use a negated expression directly in your RewriteRule directive:

    RewriteRule !^(assets|foo|bar)/ controller.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule
I would like to use .htaccess to rewrite http://localhost/css/file.css to http://localhost/css/generate is it possible
I use right now: RewriteEngine on RewriteRule !^index.html http://samedomain.com [L,R=301] so that all inquires
I use the below mod rewrite code for urls like: www.site.com/play/543 RewriteEngine On RewriteRule
Here's a redirect I have: RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1 The
I have the following rewrite rules in my .htaccess file: RewriteEngine on RewriteRule ^news/([0-9]+)/?$
im new to Mod_rewrite but problem is it ruins all my ajax and php
I have the following .htaccess rule: RewriteEngine on RewriteRule ^(.*) http://www.server2.com/index.php?action=$1 I need to
First, here's the .htaccess rule I currently use: Options +FollowSymLinks RewriteEngine on RewriteRule (.*)
I have the following apache rewrite rule: RewriteEngine On RewriteRule ^id/([^/\.]+)$ item.php?id=$1 [L] and

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.