WebsiteBaker Community Forum
General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: Xagone on October 16, 2010, 07:42:16 PM
-
here some HTACCESS trics i've done with Website Baker.
ad a 404 page within website baker by pointing it to a web page, more in my topic about "How to make legit 404 error page (https://forum.WebsiteBaker.org/index.php/topic,14897.0.html)"
Make html parsable as PHP, so you can set your settings to have your page extension to ".html"
AddHandler application/x-httpd-php5 .xml .php .htm .html
or AddHandler application/x-httpd-php .xml .php .htm .html
depending on your hosting
if you use fancybox with your template, there is some problems within Internet Explorer, this is a trick to fool IE to know where your fancybox is. (change the path to your fancybox)
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4(.*)MSIE
RewriteRule ^fancybox/([^/]*)\.png$ /path/to/fancybox/$1.png [L]
Compress all content, manually excluding specified file types (if it's not already done within apache configs)
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rar|zip)$ no-gzip
<IfModule mod_headers.c>
Header append Vary User-Agent
</IfModule>
</IfModule>
enable you to have your google sitemap as "sitemap.xml" instead of "google_sitemap.php"
RewriteEngine on
RewriteRule ^sitemap.xml$ google_sitemap.php
-
This code will be applied if you call a .html that does not phisicly exist, and will attempt to show you an .php equivalent (like http://domaind.com/allo.html, will try to show you http://domaind.com/allo.php instead)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.html$ $1.php
works if you changed your "page extension" settings but do not want to rename all your php into html.
but you need to parse html file as PHP (see above) because NEW file will be .html
-
Nice trick? What are the advantages of having .html rather than .php?
-
Visual and detherant
more cute, and if you get rid of the "/pages" the site seams to not be run by a cms, wich looks more pro.
normaly on my sites I change the /admin folder name, get rid of /pages and move to php parsed .html, so the site looks almost static.