Forum Moderators: phranque

Message Too Old, No Replies

excluding folders

         

Imagepit

12:57 am on Feb 21, 2007 (gmt 0)

10+ Year Member



Hello, im currently using mod rewrite for my root folder using a htaccess file.

For eg: when the user goes to mydomain.com/admin/, instead of the rewrite it actually goes to the mydomain/admin/ folder
but within the admin folder I still use mod rewriting for better urls.

I exclude the admin folder using

.htaccess in root


RewriteEngine on
RewriteCond %{REQUEST_URI}!^/admin/.*
RewriteRule ^([A-Za-z]+)$ /$1/ [R]
RewriteRule ^([A-Za-z]+)/$ /index.php?module=$1
AddType x-mapp-php5 .php

then in the admin folder im using a new htaccess

.htaccess in admin


RewriteEngine on
RewriteRule ^([A-Za-z]+)$ /$1/ [R]
RewriteRule ^([A-Za-z]+)/$ /index.php?setting=$1
AddType x-mapp-php5 .php

when I do
mydomain.com/admin/edit/ >> it works
mydomain.com/admin/edit >> just goes toe mydomain.com/edit/

but i thought RewriteRule ^([A-Za-z]+)$ /$1/ [R] solves not adding the slash

any input?

jdMorgan

2:14 pm on Feb 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have MultiViews enabled? If so, this may interfere with mod_rewrite.

Try


Options -MultiViews

Also, see the [NC] flag for RewriteCond and RewriteRule; It's more efficient than using [a-zA-Z].

Jim