Forum Moderators: phranque

Message Too Old, No Replies

Conflict, What is the right htaccess rule, default homepage file with

         

basketmen

9:53 pm on Jan 19, 2009 (gmt 0)

10+ Year Member



i want [url]www.domain.com[/url] is directed to the [url]www.domain.com/forum.php[/url]

usually i use this htaccess rule to define default homepage file

RewriteRule ^$ forum.php

but in one of my website, above rule is conflict with the other htaccess

RewriteRule ^((archive/)?(.*\.php(/.*)?)?)$ blog.php [L,QSA]

so the first rule is not working

please help how is the correct rule so both rule not conflict (maybe joining or split them)

i must found the answer, please help guys

jdMorgan

12:33 am on Jan 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Probably something like this:

RewriteRule ^$ forum.php [L]
#
RewriteCond $1 !^(blog¦forum)\.php$
RewriteRule ^((archive/)?[^.]+\.php(/.*)?)$ blog.php [L]

Replace the broken pipe "¦" character in the RewriteCond pattern with a solid pipe before use; Posting in this forum modifies the pipe characters.

Jim

[edited by: jdMorgan at 12:35 am (utc) on Jan. 20, 2009]

basketmen

10:00 am on Jan 20, 2009 (gmt 0)

10+ Year Member



many thanks jim, thats works

but i need to add this rule again, below rule are not working because conflict with above rule, can you please join/split above rule again with below rules

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ membersurl/$1

RewriteRule ^(install/¦tour/¦[a-z]+\.php)$ $0 [L]
RewriteRule ^([^/]+)/?$ index.php?z-profile=$1 [QSA]

[edited by: basketmen at 10:40 am (utc) on Jan. 20, 2009]

Samizdata

10:11 am on Jan 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In Jim's example there is a "broken pipe" character (meaning "or") between the words "blog" and "forum" in the rewrite condition.

This forum automatically replaces the required "solid pipe" character for security reasons.

...