Re: php as php3 perhaps with htaccess
| From: | Cranky | Date: | Mon, 03 Mar 2003 10:29:26 +0000 |
| Subject: | Re: php as php3 perhaps with htaccess | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137868@lists.php.net to get a copy of this message | ||
Thanks for this reply.
But I can not use the mod-rewrite because my site is on a shared hosting.
Another idea ?
Thanks
"Ernest E Vogelsinger" <ernest@vogelsinger.at> a écrit dans le message de
news:
5.1.1.6.2.20030303112135.030c8798@mail.vogelsinger.at...
> At 10:21 03.03.2003, Cranky said:
> --------------------[snip]--------------------
> >I have a website and all my files are *.php3
> >I would like to change the extensions of all files to *.php
> >
> >So I would like to know if there is a way perhaps with a .htaccess file
to
> >say that the file .php3 must be redirect to the same file but in *.php
> >
> >So when I try to access this page :
> >http://www.my-site.com/page.php3?param=value
> >
> >I will access this page :
> >http://www.my-site.com/page.php?param=value
> --------------------[snip]--------------------
>
> If you have the ability to use mod-rewrite, you can do
>
> RewriteEngine On
> RewriteCond %{REQUEST_URI} ^.*\.php3.*$ [NC]
> RewriteRule ^(.*)\.php3(.*)$ $1.php$2 [L]
>
> This can be done either in the general configuration, within
<VirtualHost>,
> or within <Directory>.
>
> I am using exactly this stuff to allow legacy links to a site that has
been
> developed in Python (*.py) to access the same URLs as PHP files.
>
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>