Jump to content

[SOLVED] htaccess mod rewrite help


jasonaud

Recommended Posts

i need to make this url into a seo url

 

ive looked for 2 days now and just do not understand how that works.

 

these are the urls i have now on the site. there are 312 different ones. they all follow this format.

index.php?sign=Aries&type=dailyoverview&p=1

index.php?sign=Libra&type=dailyteenhoroscopes&p=1

 

into

 

domain.com/Aries/dailyoverview/1

or

domain.com/sign/Libra/type/dailyteenhoroscope/p/1

 

what ever one is better.

 

If someone can help it would be great.

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/90028-solved-htaccess-mod-rewrite-help/
Share on other sites

you could write a header redirect like this i think

<?php
//for example 1
header('Location: http://www.domain.com/'.$_GET['sign'].'/'.$_GET['type'].'/'.$_GET['p']'./');
//for example 2
header('Location: http://www.domain.com/sign/'.$_GET['sign'].'/type/'.$_GET['type'].'/p/'.$_GET['p']'./');
//or if the names of the values change
foreach($_GET as $key => $value){
$url.=$key.'/'.$value.'/';
}
header('Location: http://www.domain.com/'.$url);
?>

 

Scott.

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.