Jump to content

Redirect from URL to php script.


DataRater

Recommended Posts

Please help me.

 

I'm using Apache 2 and PHP 5

 

I want to redirect a URL straight over to a php script and take everything after the web address as a parameter to the php file.

 

So I'm trying to do this and it doesn't work.

 

RewriteRule ^([./]*)$                  /XYZxyz.php?url=$1  [R=301,QSA,L]

 

e.g.

www.Website.com/News will send ---> XYZxyz.php?url=News

another example

www.Website.com/News/Today will send ---> XYZxyz.php?url=News/Today

 

Please help me work out the ReWrite rule.

 

Best wishes

 

Stephen

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/249136-redirect-from-url-to-php-script/
Share on other sites

I've got this working

 

RewriteRule ^([^./]*)$                  /XYZxyz.php?url=$1  [QSA,L]

 

It is working with www.Website.com/News

 

Tomorrow I'll see if the following works.

 

www.Website.com/News/Today will send ---> XYZxyz.php?url=News/Today

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.