mod_rewrite regex

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

mod_rewrite regex

Post by superdezign »

I can get this to work:

Code: Select all

RewriteCond %{REQUEST_URI} ^.*/?$
But it's too greedy. I want to have different pages for fake folders so like folder1/ would produce a different rewrite than folder1/folder2/. And strangely... This doesn't seem to work at all.

Code: Select all

RewriteCond %{REQUEST_URI} ^[^/]/?$
Ideally, the second regex would only give me requests that consisted of one folder... But it just send me to an inexistant page.

Suggestions?
ReDucTor
Forum Commoner
Posts: 90
Joined: Thu Aug 15, 2002 6:13 am

Post by ReDucTor »

The REQUEST_URI starts with a / so its going to detect it straight up.

I'm not too certain on what your trying to produce..can you also post your RewriteRule
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Ehh, it's okay. I was trying to avoid the $_GET variables ever being set, but I decided to settle for leaving them empty.
Post Reply