Re: Search Engine Friendly Url using mod_rewrite
| From: | Comex | Date: | Fri, 23 May 2003 16:59:07 +0000 |
| Subject: | Re: Search Engine Friendly Url using mod_rewrite | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148802@lists.php.net to get a copy of this message | ||
Wendell Brown wrote:
> On Fri, 23 May 2003 17:34:33 +0930, Joseph Blythe wrote:
>
>> http://index.php?id=1
>>
>> to:
>>
>> http://index.html/id/1
>
> Errrr... not a php question (so we will probably both be punished,
> but....), I think this will do what you want:
>
> RewriteEngine on
> RewriteRule index.html/id/([0-9]+) index.php?id=$1
>
> I'm using this type of functionality on one of my pages.
Or you can use PHP (tested):
[on index.php]
$m = explode("/",$_SERVER['path_info']);
for($i=1;$i<=count($m);$i = $i + 2) {
$_GET[$m[$i - 1]] = $m[$i];
}
1.41421356237309504880168872420969807856967187537694
Yes, it's true that the above isn't not false, unless it isn't.
The search is more profitable than the find.
Never, ever back down.
The e-mail given is a spam trap.
..==// Why not? \\==..