• 0

.htaccess help


Question

This is what I have now in my htaccess:

RewriteEngine On
RewriteRule ^([^/]*)/$ /l.php?l=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) http://www.tld.com/$1/ [R=301,L]

but I have an admin panel and everytime I go to tld.com/admin it automatically looks for a page like l.php?l=admin

Can someone fix my .htaccess to allow me to go to /admin/ it lets me go through?

=[

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You might want to use this as well:

RewriteCond %{REQUEST_FILENAME} !-d

You already have a !-d condition which will prevent real file paths from being rewritten, and with this extra line you can prevent real directory paths to be rewritten as well. That should make it easier for you to maintain the .htaccess file, otherwise you'd need to update it every time you add a directory. However, if your /admin/ folder is not really at that location (most hosting providers put it outside the htdocs) you'll still need a custom regular expression to specifically prevent certain paths from being rewritten, such as the condition Hot posted above.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.