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

Posted by Senator Jay Billington Bulworth on 10/10/62 11:22

"web_design" <web_design@nospam2942043.com> wrote in
news:11efpfkqhcqk26d@corp.supernews.com:

> I am trying to rewrite my PHP URLs from something like this:
>
> www.mywebsite1234.com?p=contact
> or www.mywebsite1234.com?p=page2
>
> to
>
> www.mywebsite1234.com/contact.htm
> or www.mywebsite1234.com/page2.htm (etc.)
>
> The following .htaccess code was recommended to me but it's not
> working. I read some more tutorials and I can't figure out what the
> problem is. Anyone have any ideas?
>
> RewriteEngine On
> RewriteRule ^(.+)(\.htm)$ index.php?p=$1 [L]
>
>

You may need to add a forward slash in front of index.php in the rewrite
directive. If that doesn't work, give this simpler version a shot,

RewriteEngine On
RewriteRule ^(.*).htm /index.php?p=$1

hth


--

Bulworth : PHP/MySQL/Unix | Email : str_rot13('f@fung.arg');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources

 

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

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