Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 12:21:52 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155535 Posts in 21712 Topics by 7736 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Add to your installation with htacess  (Read 861 times)
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« on: October 16, 2010, 06: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:
AddHandler application/x-httpd-php5 .xml .php .htm .html
or
Code:
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:
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:
<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:
RewriteEngine on
RewriteRule ^sitemap.xml$ google_sitemap.php
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #1 on: October 17, 2010, 04: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:
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
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
sparkdigital

Offline Offline

Posts: 348



WWW
« Reply #2 on: October 22, 2010, 11:16:59 AM »

Nice trick? What are the advantages of having .html rather than .php?
Logged
Xagone
AddOn Development
*
Offline Offline

Posts: 478



WWW
« Reply #3 on: October 22, 2010, 12: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.
Logged

Xagone Inc. (formerly VotreEspace)
http://www.xagone.com/
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!