Re: generally, where in cPanel can one set the default page to load?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Govinda wrote:
Dear list-members

I am using what I assume is a pretty standard cPanel setup (?)

I would like to be able change the mime types/extension so that ".html" gets sent through the PHP interpreter, but I see the cPanel docs say "...(note that you can not alter the system defined mime type values)..".

So as a workaround, I need to *at least* be able to change the default file to return to the browser when someone hits my domain (or a subdirectory) without specifying the page in that dir/ to load. I cannot find where in cPanel to set that. The default now is the standard "index.html". I want to change it to "index.php".
I realize this is really basic stuff, but I can't find it in my cPanel.

Can someone point me to this?

-Govinda


If you have mod_rewrite installed - put the following in your .htaccess file:


RewriteEngine on

RewriteRule ^index\.html$ index.php [L]

That will cause index.php to be called when index.html is requested.
If you want it to forward to index.php then use [R] instead of [L]

If you want all .html to be sent to php equivalents -

RewriteRule (^.*)\.html$ $1.php [L]

should do the trick.

btw - with those rules, the .html files do not need to exist. If/when they are requested, whether they exist or not, the link or redirect is made.

mod_rewrite rocks


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux