Jump to content

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.