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

Link to comment
Share on other sites

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.