Timur Gafforov
Timur Gafforov

Reputation: 761

htaccess - redirect to exact folder with different rules

I have an htaccess that makes pretty url. The content is like:

RewriteEngine On
RewriteBase /
RewriteRule ^(en|ru)/([a-z0-9_\-]+)/?$ index.php?lang=$1&section=$2 [QSA,L]

but I also have a folder - /ru/forum and I need my htaccess to have an exception for this url to parse /ru/forum/index.php . How can I do it?

Thanks in advance

Upvotes: 1

Views: 48

Answers (1)

anubhava
anubhava

Reputation: 786349

You can have it like this:

RewriteEngine On
RewriteBase /

RewriteRule ^(en|ru)/((?!forum/)[a-z0-9_-]+)/?$ index.php?lang=$1&section=$2 [QSA,L]

Upvotes: 1

Related Questions