| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
panexp
Joined: 02 Oct 2006 Posts: 4
|
Posted: Thu Dec 28, 2006 5:33 pm Post subject: rewrite rule clashing - html to php with phpbb-seo rewrite |
|
|
Hello!
I have been using the mixed mod-rewrite without any problems, but I am wanting to run a new rewrite rule for my main site files that rewrites .html to .php in the urls. (in other words, a link to page.html is actually page.php) I have it working just fine, but the rule causes a 404 when you try to view a topic in the forum. I think (??) it is caused by my new rule.
So, how can I write this rule so that it ignores anything in the /forum/ directory? (or am I going about this backwards?)
Here's a snippet of the .htaccess in my site root. My phpbb is located in /forums/:
RewriteEngine On
#add the www always
RewriteCond %{HTTP_HOST} !^www\..* [NC]
RewriteRule ^(.*) http://www.%{HTTP_HOST}/$1 [R=301]
#rewrite .html to .php
RewriteRule ^(.*).html$ $1.php
#phpBB SEO Mod addition
RewriteBase /
###########skip the credits......
# FORUM PROTECTION RULE
RewriteRule ^forums/.+/([^/]+\.html)$ /forums/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forums/.+-vc([0-9]+)\.html$ /forums/index.php?c=$1 [QSA,L]
......etc....etc....etc...etc The rest is stock mixed mod_rewrite
So, can I tell my rule to fix everything EXCEPT the /forum/ or is there a better fix? |
|
|
| Back to top |
|
 |
|
 |
panexp
Joined: 02 Oct 2006 Posts: 4
|
Posted: Thu Dec 28, 2006 6:40 pm Post subject: Re: rewrite rule clashing - html to php with phpbb-seo rewrite |
|
|
Well, I managed to answer my own question! Maybe this will help someone else:
Just add a RewriteCond to the rule:
RewriteCond %{REQUEST_URI} !^.*forums.*$
RewriteRule ^(.*).html$ $1.php
If any knows a better way to do this let me know!! |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |