PDA

View Full Version : SEF (search engine friendly) URLS on localhost/php


homerUK
01-17-2006, 03:57 PM
Ive been searching for hours and not found a definitive answer to this - but how can you get IIS (windows xp pro) to read .htaccess files and therefore allow search engine friendly urls??

I've tried all sorts..... I believe it's possible with APACHE server, so should I just use that instead of IIS - if so, is it easy to set up??

thanks :)

schleppel
01-17-2006, 05:40 PM
Some different mod_rewrite like add-ons for IIS: http://www.petefreitag.com/item/286.cfm. Not sure how they work though, as i don't use IIS.

Or you might be able to use /page.php/some/stuff/ and get it in your script with:
<?php

// there might be a simpler way
$uri = str_replace(str_replace(getenv('DOCUMENT_ROOT'),
'',str_replace('\\','/',__FILE__)),'',getenv('REQUEST_URI'));

// input URI: /page.php/some/stuff
// oputput: /some/stuff
echo $uri;

?>
and then you could break it up to get the values you want.