Help with .htaccess
Posted: Wed Mar 24, 2010 2:23 pm
Hi everyone,
I'm having a little trouble with this htaccess problem- I only want to add a conditional slash instead of using 2 different statements. Here's the file, the commented out bit almost worked but got a little sketchy with more than 2 URI parameters:
Does anyone know how to fix this? Thanks in advance,
Ben
I'm having a little trouble with this htaccess problem- I only want to add a conditional slash instead of using 2 different statements. Here's the file, the commented out bit almost worked but got a little sketchy with more than 2 URI parameters:
Code: Select all
RewriteEngine On
# These don't work quite right
# RewriteRule ^admin/?([^/]*[/?])$ admin.php/$1 [QSA,L]
# RewriteRule ^mob/?([^/]*[/?])$ mobile.php/$1 [QSA,L]
# These work fine but require 2 statements per file
RewriteRule ^admin$ admin.php/$1 [QSA,L]
RewriteRule ^admin/(.*)$ admin.php [QSA,L]
RewriteRule ^mob$ mobile.php [QSA,L]
RewriteRule ^mob/(.*)$ mobile.php/$1 [QSA,L]
# This bit is the fallback
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]Ben