John Sladek on 14 May 2008 14:07:32 -0700

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

Re: [PLUG] regex question

I did not even consider subdirectories...  It sounds like the right way to 
go so, I tried what you put but it did not work for me.. Of course I changed 
it a little and that could be the problem . Here is my exact .htaccess file 
as it is now.

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 did make a test subdirectory to see how my original solution would 
deal with subdirectories and it seems to work as long as I have the / after 
the directory name.  I'm pretty sure the .htaccess file only works on the 
requests that are in the same directory as it is in.  It did not seem to 
break anything but it's a site from scratch so there is not much there.


> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule ^/(.*)$ /public.php?page=$1 [L]
> </IfModule>
> Let me know if you need anything else with this.
> Cheers,
> Joe Terranova
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --  
> Announcements - 
> General Discussion  --  

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --