Doubt about RewriteRule: it won't mask, but redirect

Hi.

With Apache/2.0.52 on my server, I want to convert
http://www.mydomain.com/index.php/2005/09/08/foo
into
http://www.mydomain.com/2005/09/08/foo
with RewriteRule

I modified my 'httpd.conf':

-----------
<VirtualHost mydomain.com:80>
ServerAdmin john [at] mydomain.com
DocumentRoot "/home/mydomain/web"
ServerName www.mydomain.com
ErrorLog logs/mydomain-error_log
CustomLog logs/mydomain-access_log "%h %l %u %t \"%r\" %>s %b
\"%{Referer}i\" \"%{User-agent}i\""
DirectoryIndex index.php
RewriteEngine On
RewriteRule ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*)
http://www.mydomain.com/index.php/$1/$2/$3/$4 [QSA,L]
<Directory "/home/mydomain/web">
Options Indexes +FollowSymLinks
</Directory>
</VirtualHost>
-------

(/home/mydomain/web/index.php is a soft link to /home/foo/index.php)

But when trying to access to:
http://www.mydomain.com/2005/09/08/foo
it redirects to:
http://www.mydomain.com/index.php/2005/09/08/foo
and doesn't mask it, as I supposed. I mean, I can see this URL on my
browser.

Whay am I doing wrong? Thank you very much.
francescomoi [ Do, 08 September 2005 20:36 ] [ ID #957847 ]

Re: Doubt about RewriteRule: it won't mask, but redirect

<francescomoi [at] usa.com> schreef in bericht
news:1126204586.260871.184680 [at] o13g2000cwo.googlegroups.com.. .
> With Apache/2.0.52 on my server, I want to convert
> http://www.mydomain.com/index.php/2005/09/08/foo
> into
> http://www.mydomain.com/2005/09/08/foo
> with RewriteRule
>
> I modified my 'httpd.conf':
> RewriteEngine On
> RewriteRule ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*)
> http://www.mydomain.com/index.php/$1/$2/$3/$4 [QSA,L]
> But when trying to access to:
> http://www.mydomain.com/2005/09/08/foo
> it redirects to:
> http://www.mydomain.com/index.php/2005/09/08/foo
> and doesn't mask it,
You should not tell the browser the other link... so try
RewriteRule ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*) /index.php/$1/$2/$3/$4 [L]
or in case of failure
RewriteRule ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*) /index.php/$1/$2/$3/$4 [PT,L]

HansH
HansH [ Do, 08 September 2005 22:57 ] [ ID #957852 ]
Webserver » alt.apache.configuration » Doubt about RewriteRule: it won't mask, but redirect

Vorheriges Thema: Newbie question: Mime type for iso files
Nächstes Thema: Pdf grant in Directory Alias allowed through referer