Author Topic: Add to your installation with htacess  (Read 2507 times)

Offline Xagone

  • Posts: 482
  • Gender: Male
  • Developper
    • Xagone Inc
Add to your installation with htacess
« 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"

Make html parsable as PHP, so you can set your settings to have your page extension to ".html"
Code: [Select]
AddHandler application/x-httpd-php5 .xml .php .htm .html or
Code: [Select]
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)
Code: [Select]
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)
Code: [Select]
<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"
Code: [Select]
RewriteEngine on
RewriteRule ^sitemap.xml$ google_sitemap.php
Xagone Inc. (formerly VotreEspace)
http://xagone.com/

Offline Xagone

  • Posts: 482
  • Gender: Male
  • Developper
    • Xagone Inc
Re: Add to your installation with htacess
« Reply #1 on: October 17, 2010, 05:40:58 PM »
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)
Code: [Select]
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
Xagone Inc. (formerly VotreEspace)
http://xagone.com/

Offline sparkdigital

  • Posts: 366
  • Once a baker, always a baker!
    • romantic hotels
Re: Add to your installation with htacess
« Reply #2 on: October 22, 2010, 12:16:59 PM »
Nice trick? What are the advantages of having .html rather than .php?

Offline Xagone

  • Posts: 482
  • Gender: Male
  • Developper
    • Xagone Inc
Re: Add to your installation with htacess
« Reply #3 on: October 22, 2010, 01:27:11 PM »
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.
Xagone Inc. (formerly VotreEspace)
http://xagone.com/