You are here: Re: Rewriting URLs « All PHP « IT news, forums, messages
Re: Rewriting URLs

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация