-2

Guys please help me with this

I want to replace this URL http://www.mywebsite.com/index?type=traveler with http://www.mywebsite.com/index/traveler

http://www.mywebsite.com/index?type=traveler is a hyperlink on some other page

I have tried many things but haven't succeeded till now.

2 Answers2

0

You'll just need to add a few lines to your .htaccess file:

RewriteEngine On
RewriteRule index/(.*) index?type=$1 [L]

This will use "traveler" as your type parameter. It will catch any other value and send to the querystring as the type value as well.

Kevin Roth
  • 302
  • 1
  • 4
  • 14
0

Get the url and compare with this condition then include your page and exit.

if (strstr($url, 'index/')) {
$urlarr = explode('product/', $url);
$url = $urlarr[1];
$sing_ext = strpos($url, "'");
if ($sing_ext != false) {
    $ur_ar = explode("'", $url);
    $url = $ur_ar[0];
}
$sub_cats_url = $_REQUEST['tag'] = $urlarr[1];

include("product.php");
exit;    }
naveen kumar
  • 441
  • 5
  • 15