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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:41:56+00:00 2026-06-05T20:41:56+00:00

I hope you can help, I’ve tried for hours to understand mod rewrite but

  • 0

I hope you can help, I’ve tried for hours to understand mod rewrite but I just seem to be getting no where.

What I’m trying to achieve is a mod_rewrite that takes the whole url as a var unless it begins with something like ‘/images/…..’ etc

the idea being that all my pages are in a table and then found and processed from then on.

Currently I have

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?url=$1    

This works to a point,
any URL I can get using $_GET which is great, but I don’t want to use request_filename conditions,

id like in the rewrite rule to exclude if url == ‘/images/’ or == /css/ etc

Hopefully this makes sense, and i’m sure this is easy.
Also if you have any thought about how to improve the way im trying to achieve this that’d be of use then please let me know.

Cheers!


currently got

RewriteEngine On
RewriteBase /

RewriteRule ^/images/ - [L]
RewriteRule ^/css/ - [L]
RewriteRule (.*) index.php?url=$1 

thanks to Alexander but $_GET[‘url’] == ‘index.php’

  • 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-05T20:41:58+00:00Added an answer on June 5, 2026 at 8:41 pm

    Place a rule for those directories first and use the [L] flag.

    RewriteRule ^images/ - [L]
    RewriteRule ^css/ - [L]
    RewriteRule (.*) index.php?url=$1
    

    An untested alternative could be also:

    RewriteCond %{REQUEST_URI} !^/images/
    RewriteCond %{REQUEST_URI} !^/css/
    RewriteRule (.*) index.php?url=$1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hope can help, trying out Jquery clone which seems to work, but I get
Hope somebody can help. Have looked around on the net but cannot seem to
hope you can help me (tried lots of things here, but nothing worked) i
Hope someone can help i cant seem to get my head around this, i
Hope someone can help me out with this problem I am having. I just
I hope you can help. This has been confounding me for hours. I have
I hope somebody can help me. I've been trying to write a custom html
Hope someone can help as I am quite new to SSRS, I am trying
hope someone can help. just cannot get a new window to open in Firefox
Hope someone can help me as I've been searching for hours. I'm planning on

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.