Help: Redirect dynamic URL

Alles, was PHP betrifft, kann hier besprochen werden.

Help: Redirect dynamic URL

Postby vrsotto » 07. October 2015 05:24

Hi guys,

noob here. how do i redirect:

Code: Select all
http://domain.com/members/index.php/register/params?item=1&pname=productname&pid=1289465219


to

Code: Select all
http://members.domain.com/index.php/register/params?item=1&pname=productname&pid=1289465219


with htaccess? where "item", "pname" and "pid" vars are dynamic.

thanks
vrsotto
 
Posts: 1
Joined: 07. October 2015 05:13
Operating System: Win7

Re: Help: Redirect dynamic URL

Postby Nobbie » 07. October 2015 11:17

vrsotto wrote:
Code: Select all
http://domain.com/members/index.php/register/params?item=1&pname=productname&pid=1289465219


This is a strange URL, do you see that the filename "index.php" is followed by a folder "register/params"? Are you sure, that this is the right URL?

A redirect is very simply to accomplish, proceed to the DocumentRoot, and insert a simple Redirect in .htaccess:

Redirect /members/index.php/register/params http://members.domain.com/index.php/register/params

The URL Parameters (also called "Query String") is automatically appended correctly.
Nobbie
 
Posts: 8759
Joined: 09. March 2008 13:04


Return to PHP

Who is online

Users browsing this forum: No registered users and 2 guests