Joe Terranova on 14 May 2008 16:41:02 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] regex question


> AddType x-mapp-php5 .php
>
> Options -MultiViews
> RewriteEngine on
> RewriteBase /
>
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^/(.*)$ /public.php?sub=$1 [L]
>
> #RewriteRule ^([^/\.]+)/?$ /public.php?sub=$1 [L] #original working
>
> It will work if I uncomment the original line and comment out the other
> three.

I wrote mine blind at work. This works fine:
RewriteRule ^(.*)$ /index.php?sub=$1 [L]
or using your original one seems to work fine as well. The main
benefit to the RewriteCond's is that it allows you to have anything
else -- such as images -- in the path.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug