Hello there,

I'm trying to create a rewrite condition for a set of rewrite rules. Currently this is what I have:

RewriteCond %{HTTP_HOST} ^/?forum			[NC]
RewriteRule ^([\w]+)/([\w]+)/?$				index.php?p=$1&s=$2 [NC,L,C]
RewriteRule ^([\w]+)/?$					index.php?p=$1 [NC,L]

What I want is to redirect http://www.mywebsite.com/PAGE1/PAGE2 to http://www.mywebsite.com/index.php?p=PAGE1&s=PAGE2, except when the URI starts with "forum" (for example http://www.mywebsite.com/forum). However, my rewrite condition is not working right now. Can anyone please help me?

Trying this:

RewriteCond %{HTTP_HOST} ^/?forum			[NC]
RewriteRule ^([\w]+)/([\w]+)/?$				index.php?p=$1&s=$2 [NC,L,C]
RewriteRule ^forum/?$					index.php?p=forum [NC,L]
RewriteRule ^([\w]+)/?$					index.php?p=$1 [NC,L]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.