Hey guys,
Heres another ExpressionEngine extension to add to my list of EE Addons. Introducing LG .htaccess Generator.
LG .htaccess Generator Multi-Site Manager compatible ExpressionEngine extension that automatically generates and updates your sites .htaccess file everytime an entry, template group or template is created or modified.
Using special {ee:} tags LG .htaccess Generator allows you to easily remove your sites index.php file using the “Include List Method”.
Check out the documentation which is now available on my site!
Enjoy, feedback is appreciated.
Here it is, I am on MediaTemple in case you’re wondering.
Why Pastie BTW?
UPDATED: Added the remainder of the .htaccess
AddHandler php5-script .php
# -- LG .htaccess Generator Start --
# .htaccess generated by LG .htaccess Generator v1.0.0
# http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/
# secure .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Dont list files in index pages
IndexIgnore *
# EE 404 page for missing pages
ErrorDocument 404 /index.php?/
# Simple 404 for missing files
<FilesMatch "(\.jpe?g|gif|png|bmp)$">
ErrorDocument 404 "File Not Found"
</FilesMatch>
RewriteEngine On
RewriteBase /
# remove the www
RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Add a trailing slash to paths without an extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ $1/ [L,R=301]
RewriteRule ^(.*)$ $1/ [L,R=301]
# Remove index.php
# Uses the "include method"
# http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(site|about|global|about|contact|registration|team|sponsors|donors|news|events|blog|contact|events|party|monkey|generator|global|d$
RewriteRule ^(.*)$ /index.php?/$1 [L]
# Remove IE image toolbar
<FilesMatch "\.(html|htm|php)$">
I figured it out. I forgot that the extension will create the .htaccess for all MSM domains. I have a directory called admin on another domain. The reason its there is for my clients to go to /admin instead of /admin.php. Any ideas to work around this? I’m thinking that I just need to delete the other domains until they are actually using them.
This is the setup i used: http://expressionengine.com/docs/installation/masked_cp_access.html
I will have to create the 404 Page soon.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.