Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Rewrite 2 pages Rule Condition

Condition for 2 pages



7:56 pm on Aug 3, 2007 (gmt 0)

5+ Year Member


Maybe this is not possible or maybe this is very basic.. Well I want to do that:

I have two dynamic pages index.php show the main categories and pages.php show the page content. (same.. root)

I want to do something like that, and of course it is not running.. (when condition is from index.php display index.php page)

RewriteCond %{QUERY_STRING} &?main_tab=([^&]+)
RewriteRule ^(.+).html$ /index.php?main_tab=$1

RewriteCond %{QUERY_STRING} &?pages=([^&]+)
RewriteRule ^(.+).html$ /pages.php?article=$1

for example
in index.php?main_tab=bags I want to see something like this:

in RewriteRule ^(.+).html$ /pages.php?article=leather-bags
I want to see something like this:

Of course these rules should be in the same htaccess.

Thanks very much for the help...


9:24 am on Aug 4, 2007 (gmt 0)

5+ Year Member

There is an excellent post by Jim called Changing Dynamic URLs to Static URLs [webmasterworld.com] that will help you out.



1:04 am on Aug 5, 2007 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

This question comes up almost daily now.

Check the threads over the last few weeks.


4:32 pm on Aug 5, 2007 (gmt 0)

5+ Year Member


Really I did not find out information about it on the forum... Please can you tell me where is post?

thanks very much


6:41 pm on Aug 5, 2007 (gmt 0)

5+ Year Member




Featured Threads

Hot Threads This Week

Hot Threads This Month