LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   htaccess rewrite rule (https://www.linuxquestions.org/questions/linux-server-73/htaccess-rewrite-rule-904218/)

asifbasha 09-21-2011 09:47 AM

htaccess rewrite rule
 
Hai to all

I am using fedora 15 system with apache server in my php development environment .. I am not an expert in htaccess rewrite rule. my request is i have to rewrite the below rule like this


from : www.xyz.com/test.php?&name=check&id=25

to : www.xyz.com/test.php/check

the name value and id value will change dynamically , because i am retrieving mysql row from id value .. and this rule should apply only for test.php

any idea will help me

thanks in advance to all ..

bathory 09-21-2011 12:48 PM

Hi,

You may try the following:
Code:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^&name=(.*)&id=(.*)
RewriteRule test.php(.*) /test.php/%1? [R]

Quote:

the name value and id value will change dynamically , because i am retrieving mysql row from id value
I don't see where the id value is involved, but if you need it in some manner you can use %2 for it

Regards


All times are GMT -5. The time now is 09:17 AM.