| 
 Posted by Markus L. on 07/10/05 03:45 
Am Fri, 08 Jul 2005 15:32:30 -0400 schrieb web_design: 
 
> I'm trying to figure out how to change php-generated URLs like this: 
>  
> http://www.mywebsite1234.com?p=cars 
>  
> into URLs like this: 
>  
> http://www.mywebsite1234.com/cars/ 
>  
> or, even better: 
>  
> http://www.mywebsite1234.com/cars.htm 
>  
> I found a tutorial online 
> http://www.devshed.com/c/a/Apache/Search-Engine-Friendly-URLs-with-mod-rewrite/ 
> but it doesn't explain things very well.  Do you have to write a separate 
> rule for each URL that you want changed?  Is there an automatic way to do 
> it? 
>  
> thanks 
 
 
No, you can explain a general rule for all pages with regular expressions: 
 
RewriteEngine On 
RewriteRule    ^(.+)(\.htm)$    index.php?p=$1    [L] 
 
 
--  
------------------------------------------------------- 
Try this: SCA the Smart Class Archive for PHP 
http://www.project-sca.org 
-------------------------------------------------------
 
  
Navigation:
[Reply to this message] 
 |