Mod Rewrite Help

Shadow121

Member
Messages
901
Reaction score
0
Points
16
Hi there. I'm trying to rewrite some URLs and it isn't working too well. I currently have:
Code:
Options -Indexes

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^(.*)/?$ modules/$1

for my .htaccess and that works for juts visiting the index.php and the admincp/index.php. But when I want to go to my users module say: mysite.com/users/login/ it comes up with a 404 not found. I tried turning ^/?$ to !^/?$ and that worked but I couldn't access the adminCP.

Any suggestions or help?

I got it to work. For some reason, removing the ? from the Rewrite cond and changing it to SCRIPT_FILENAME all three options above work. Current Rewrite Syntax:
Code:
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !^/$
RewriteRule ^(.*)/?$ modules/$1
 
Last edited:

Mitch

New Member
Messages
908
Reaction score
0
Points
0
Try adding this line after RewriteEngine on:

Code:
RewriteBase /
 
Last edited:
Top