httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Mearns <>
Subject Re: [users@httpd] Problem with Mod_Rewrite
Date Tue, 14 Apr 2009 22:14:10 GMT
On Tue, Apr 14, 2009 at 3:32 PM, ricardo13 <> wrote:
> Hi all,
> I have other doubt about mod_rewrite.
> Have this line in httpd.conf:
> RewriteEngine on
> RewriteRule ^/index/([0-9]+)/$ /index.html?id=$1
> When type "http://localhost/index.html?id=11" it doesn't show URL
> "http://localhost/index/11/"
> I saw this example in a site.
> What's happen ???
> Ricardo
> --

It looks like you're trying to do what's called "pretty URLS"; the
idea is to hide some ugly details about how your site actually works
(like passing query string values to a server side script) inside an
easier to remember and more natural looking URL. The being the case,
you would not generally want your users to enter
"http://localhost/index.html?id=11" as the URL, because that's not
very pretty. It's much nicer for a user to browse to
"http://localhost/index/11/" and have that handled correctly, which is
exactly how you have your RewriteRule set up. So it looks like your
rule is probably correct, you just misunderstood what it's used for.


Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message