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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:41:39+00:00 2026-05-12T07:41:39+00:00

Currently this is my .htaccess RewriteEngine on #rewrite the url’s RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]

  • 0

Currently this is my .htaccess

RewriteEngine on
#rewrite the url's
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]

So, from the index i render a template, and give it a url.

Normally a page would look like this
http://www.whatever.com/?url=test/page

But with the rewrite it goes
http://www.whatever.com/test/page

So the question is {

I have an admin section of the site that I want unaffected by this.
So, /admin needs to access the admin folder in the folder tree.
Thanks for the help

-Wes

  • 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-12T07:41:39+00:00Added an answer on May 12, 2026 at 7:41 am

    The best way to do this is to not re-write the URL’s of real files and directories on the filesystem. This can be achieved by adding a couple rewrite conditions to your rule:

    RewriteCond %{REQUEST_FILENAME} !-s [OR]
    RewriteCond %{REQUEST_FILENAME} !-l [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
    

    Now, these mean, respectively, only rewrite urls that are: not a real file (with > 0 size), not a symlink, and not a directory.

    Alternatively, you could just make sure your rule does not match your admin directory:

    RewriteCond  %{REQUEST_URI} !^/admin
    RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
    

    The first example is by far the most flexible, however, as it won’t interfere with any static files, such as images, etc.

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

Sidebar

Related Questions

I want to rewrite my url from: http://mysite.com/index.php?node=home&photoID=10 to: http://mysite.com/home/10 Currently, for just http://mysite.com/home
I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1
Currently my .htaccess looks like this... Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}
How do you rewrite a url with a # in? e.g. http://www.example.com/index.php#test In my
I have mod_rewrite take this url: mydomain.com/directory/index.php?slug=slug&year=2009 and make it pretty: mydomain.com/directory/slug/2009/ Easy, but
I have effectively used the rewrite rule to change my url from /teams.php?team=New York
I have a forum that is currently accessible through the URL: www.website.com/index.php?app=forums Instead of
Good morning. I currently have this little rule in my .htaccess RewriteEngine On RewriteBase
This is currently my htacess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond
My current htaccess file is this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

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.