Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

URL rewrite exceptions

11 views
Skip to first unread message

mou

unread,
Jun 5, 2007, 6:55:11 AM6/5/07
to Apache .htaccess
Hi

I'm trying to implement the following URL structure using .htaccess:

User sees:
http://domain.com/layer1/layer2/

Server sees:
http://domain.com/index.php/layer1/layer2

Ive managed to get this working with the following .htaccess file:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

HOWEVER - inevitably, this rewrites the URL of everything its given.

How would I add an exception? For example, I want a way of expressing
this:

IF url = http://domain.com/forum/ THEN open the 'forum' folder.
ELSE process the rule above (ie, drop 'index.php' into the URL)

Anyone know of a way of doing this? Can it be added to the .htaccess
file I already have, or am I looking like having to find a different
way around it?

mou

unread,
Jun 5, 2007, 1:19:50 PM6/5/07
to Apache .htaccess
p.s. Its not necessarily limited to 2 "layers" - ie, domain.com/
layer1/layer2/ .... it could have as few as none or as many as 4

- Chris

On Jun 5, 11:55 am, mou <mou.me...@googlemail.com> wrote:
> Hi
>
> I'm trying to implement the following URL structure using .htaccess:
>
> User sees:http://domain.com/layer1/layer2/
>
> Server sees:http://domain.com/index.php/layer1/layer2
>
> Ive managed to get this working with the following .htaccess file:
>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . /index.php [L]
>
> HOWEVER - inevitably, this rewrites the URL of everything its given.
>
> How would I add an exception? For example, I want a way of expressing
> this:
>

> IF url =http://domain.com/forum/ THEN open the 'forum' folder.

Reply all
Reply to author
Forward
0 new messages