Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
My current .htaccess file looks like this:

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*).html$ index.php?page=$1 [L]

So when the url is test.html it is redirected to index.php?page=test.

I would like to send a parameter like this: test.html?id=8 and have it
redirected to index.php?page=test&id=8.

How do I change the rewriterule to achieve that?

If there is no argument in the html page it shall be redirected like
it was before.

Kind regards,

Jan Nordgreen

Re: .htaccess

Quoted text here. Click to load it

Can't you use "test.php" and implement a php variable to that effect?

http://www.neredbojias.net /
Great sights and sounds

Re: .htaccess

damezumari wrote:

Quoted text here. Click to load it

RewriteRule ^(.*).html$ index.php?page=$1 [L,QSA]

QSA stands for "Query String Append"

Kim André Akerø
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

Re: .htaccess

Excellent Kim! Thanks!

(Fra en nordmann til en annen. :))

Jan Nordgreen

Site Timeline