| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| SQLdumpster.com | Hey. I would be very grateful if someone could help me with the following; I have a series of PHP files which I would like accessible as .html (e.g. index.html actually points to index.php). However, when trying to view fckeditor.html file, it's looking for fckeditor.php (and presents a "300 multiple choices" Bullcrap). Until switching to 1and1.co.uk hosting, it worked fine. Here is the .htaccess: Code: ErrorDocument 404 /404-page-not-found.html
#AddType application/x-httpd-php .php .php3 .phtml .html
AddType x-mapp-php4 .html
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*).html /$1.php [QSA,L]
Code: RewriteRule (.*).html /$1.php [QSA,L] Code: RewriteCond %{SCRIPT_FILENAME} !-f
Many thanks
__________________ !!!!!!! see something you like? Accepting offers for great affiliate websites !!!!!!! Free Databases for your Website | All Things Playstation 3 Website Design Books | Music While You Work? | Computer Gadgets Last edited by miseria; 06-30-2008 at 02:53 PM. |
| |
| | #2 (permalink) |
| i love automation | You can try this ![]() Code: RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*).html $1.php [QSA,L]
__________________ Xrvel | Various online tools | Free Proxy List | Hidden Proxy Partai Golkar | Noomle works : Las Vegas Airfare |
| |
| | #3 (permalink) |
| SQLdumpster.com | Thanks but now PHP files do not run with .html. Just some advice: do not choose 1and1 for web hosting
__________________ !!!!!!! see something you like? Accepting offers for great affiliate websites !!!!!!! Free Databases for your Website | All Things Playstation 3 Website Design Books | Music While You Work? | Computer Gadgets |
| |
| | #4 (permalink) |
| New Member | Greetings. You can configure your apache to process php in .html files a much easier way than using rewrites and .htaccess Just edit your config file for the php apache module and add .html to the end of the line. Here is an example. Code: AddType application/x-httpd-php .php .phtml .php3 .html Code: php.conf Regards, Richard. |
| |
| | #5 (permalink) |
| SQLdumpster.com | Hi Richard. Thanks for your help and welcome to Namepros. I think this will be the likely solution (using the .htaccess though and not the conf file). The problem is; with 1and1, you have to use an alternate method which is a bit of a snag: Code: AddType x-mapp-php4 .html
__________________ !!!!!!! see something you like? Accepting offers for great affiliate websites !!!!!!! Free Databases for your Website | All Things Playstation 3 Website Design Books | Music While You Work? | Computer Gadgets |
| |
| | #6 (permalink) |
| New Member | Perhaps I did not understand what you wanted to do. I thought you wanted to execute PHP from .html files ? If you want your .php to be used as .html, then rename them to .html and 301 the old .php to the .html and you're done. Keep it simple and don't confuse the user or the SE's. - Richard |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |