Re: Rewriting URLs -- problem
- From: Senator Jay Billington Bulworth <f@xxxxxxxx>
- Date: Thu, 28 Jul 2005 00:56:02 GMT
"web_design" <web_design@xxxxxxxxxxxxxxxxx> wrote in
news:11efpfkqhcqk26d@xxxxxxxxxxxxxxxxxx:
> 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@xxxxxxxx');
--------------------------|---------------------------------
<http://www.phplabs.com/> | PHP scripts, webmaster resources
.
- References:
- Rewriting URLs -- problem
- From: web_design
- Rewriting URLs -- problem
- Prev by Date: Re: Seeking Dating code in PHP
- Next by Date: Re: which IDE for php ?
- Previous by thread: Re: Rewriting URLs -- problem
- Index(es):
Relevant Pages
|