Link to home
Start Free TrialLog in
Avatar of Headchopperz
Headchopperz

asked on

htaccess regex in modrewrite help

Ok so, i have a folder, which contains php scripts.
I wana make it so if its a script i dont want them to see, i easily throw them to a 404 page.
However, for this one folder, there is one subfolder i still need to give them access to. Now im kinda new to regex but i gave it a go:

^PATH/(?!ajax)(.*)\.php$

or

^PATH/(?!ajax.*)\.php$

The idea is, every .php file they try to access will redirect them to the 404, apart from a folder containing the text ajax.

Does anyone know how i can get this regex to work?
Avatar of ozo
ozo
Flag of United States of America image

the former seems to correspond better with your description
ASKER CERTIFIED SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial