rewrite "bla.php?test,test,test"

Using mod_rewrite to handle various content issues

rewrite "bla.php?test,test,test"

Postby Guest » Sun Dec 26, 2004 8:43 am

How would I rewrite "bla.php?test,test,test" to something like /link/link or something?
Guest
 

Postby Caterham » Mon Dec 27, 2004 9:08 am

Hi.

Whar do you exactly want?

your script/ "real URL looks like bla.php?test,test,test.

First, you have to change the links into the desided form, may be /link/link within your php script

It seems to be, that 3rd Party modules for apache are available, which will also change your URLs within the source code.

But the usual way is
- change all links in the php script into the static form
- use mod_rewrite to rewrite the incomming static requests to your script

To rewrite
/link/link to bla.php?link,link you can use in a .htaccess file
Code: Select all
RewriteEngine On
RewriteRule ^(.[^/]+)/(.[^/]+)/?$ bla.php?$1,$2 [L]


Bob
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby Guest » Mon Dec 27, 2004 9:44 am

Thank you b0b :)
Guest
 


Return to Content

Who is online

Users browsing this forum: No registered users and 16 guests

cron