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: 13165
Joined: 09. March 2008 13:04

Re: Help: Redirect dynamic URL

Postby tim_ » 21. March 2017 13:42

Hi, I know this is the old post, however - the only good way for any redirect is to do it in .htaccess
tim_
 
Posts: 4
Joined: 21. March 2017 13:30
XAMPP version: 5.5.24
Operating System: windows


Return to PHP

Who is online

Users browsing this forum: No registered users and 53 guests