Hi all,

Here is my htaccess code for url rewrite:

RewriteRule ^(.*)/test.php$ test.php?language=$1 [NC]

which will redirect
www.domain.com/english/test.php
to
www.domain.com/test.php?language=english
It is working fine...

But when i have extra variable with that url then it doesn't work.
e.g. www.domain.com/english/test.php?name=abc
should work like:
www.domain.com/test.php?language=english&name=abc

But it is not working..
Help !!

Recommended Answers

All 3 Replies

RewriteRule ^(.*)/test.php\?(.*)$ test.php?language=$1&$2 [NC]
RewriteRule ^(.*)/test.php$ test.php?language=$1 [NC]
RewriteRule ^(.*)/test.php\?(.*)$ test.php?language=$1&$2 [NC]
RewriteRule ^(.*)/test.php$ test.php?language=$1 [NC]

Nope still this is not working.

I got solution....
If htaccess is applied for language then

www.domain.com/english/test.php?name=abc

should be

www.domain.com/english/test.php&name=abc

without question mark.
This solved my problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.