Multiple parameters for same .php

New to mod_rewrite? This is a good place to start.

Multiple parameters for same .php

Postby SolidBender » Thu Apr 21, 2005 9:28 am

Hi guys,
I think it is a beginner level question so I posted my message in here :)

First my current .htaccess file;

RewriteEngine on
RewriteBase /
rewriteCond %{HTTP_HOST} !^www\.
rewriteCond %{HTTP_HOST} ^(.+)\.domain\.com
rewriteRule ^([0-9]+)$ http://www.domain.com/items.php?pf=%1&page=$2 [P,L]


what i am doing here is; when you put the URL like sub.domain.com/page=1 apache rewrite is as www.domain.com/items.php?pf=sub&page=1 and works fine.

However, when you click the button from the mainpage i'd like to send my URL as sub.domain.com and this time my modrewrite doesnt work with my current rules. Is there anyway to create two rules when there is an parameter do rule1 and if there is no parameter do rule2. do you guys have any idea ? hope i did myself clear.

-s
SolidBender
 
Posts: 3
Joined: Thu Apr 21, 2005 9:20 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 32 guests

cron