httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomek Lorek" <tlo...@gmail.com>
Subject Re: [users@httpd] mod_rewrite rewrites but changes uri to filepath
Date Mon, 08 Oct 2007 20:01:30 GMT
Ok guys, I've got the final solution! :) It is the RewriteBase, not the PT
flag.

RewriteEngine On
RewriteBase /~username/somesite/
RewriteRule .....

Best regards,
teel


2007/10/7, Joshua Slive <joshua@slive.ca>:
> On 10/7/07, Tomek Lorek <tlorek@gmail.com> wrote:
> > Hi there!
> > I'm having problems setting up a mod_rewrite on Apache 2.2.3. I have
> > an address like this: http://127.0.0.1/~tomek/somesite/register.php
> > and it works ok. I've got a /home/tomek/public_html/somesite/.htaccess
> > file which contains:
> > RewriteEngine On
> > RewriteRule ^(.+)\.html$ $1.php [L]
> > The rule in this special example is simple (my target one is much more
> > complicated but that's not the problem): it should substiture html
> > with php and that's all. But when requesting this uri:
> > http://127.0.0.1/~tomek/somesite/register.html (HTML instead of PHP) I
> > get this 404 error: "The requested URL /home/tomek/public_html/
> > somesite/register.php was not found on this server."
> > So mod_rewrite successfully replaced html with php but Apache
> > converted this uri to the filesystem path, don't know why. By the way
> > the file do exists on the filesystem.
>
> Since your doing this per-dir (rather than the simpler server-level
> config), you'll need to set an appropriate RewriteBase.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message