ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

LG .htaccess help: How to make the 'site' templates display without the 'site' being in URL?

June 07, 2009 2:14am

Subscribe [3]
  • #1 / Jun 07, 2009 2:14am

    Ludvik Herrera

    31 posts

    Hello:

    I am using many of LG’s plugins and extensions. I found the LG .htaccess very sweet, but now I have a question:

    I have my default template ‘index’ inside the ‘site’ group template. Since my default templates is this ‘site’ group template, I would like the URL be http://www.mysite.com/contact/ instead of http://www.mysite.com/site/contact/

    I think I would like generic pages/templates inside the ‘site’ template group without having to create their own template group.

    I am not sure how can I fix the .htaccess template that is in the extension LG .htaccess. Your help would be appreciated.

    Here is my current .htaccess parsed:

    # -- LG .htaccess Generator Start --
    
    # .htaccess generated by LG .htaccess Generator v1.0.0
    # <a href="http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/">http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/</a>
    
    # secure .htaccess file
    <Files .htaccess>
     order allow,deny
     deny from all
    </Files>
    
    # Memory Allocation
    php_value memory_limit 32M
    
    # 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]
    
    # Remove index.php
    # Uses the "include method"
    # <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method">http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method</a>
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} ^/(site|search|shop|about|customer_care|includes|about|members|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    # Remove IE image toolbar
    <FilesMatch "\.(html|htm|php)$">
      Header set imagetoolbar "no"
    </FilesMatch>
    
    # -- LG .htaccess Generator End --
    
    
    AddHandler php5-script .php
  • #2 / Jun 11, 2009 1:59am

    mhulse

    329 posts

    Hi,

    I am doing the same thing… I am just using one template to handle all of my content. This worked for my site:

    ...
    ...
    ...
    ...
    ...
    # Remove index.php
    # Uses the "include method"
    # <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method">http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method</a>
    #Handle comment redirection
    ##############################################
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^home/?(.*)$ /$1 [R=301,L]
    ##############################################
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} ^/({ee:template_groups}|entry|categories|tags|archives|members|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php?/home/$1 [L]

    You might try the above, but replace “home” for “site”. “home” is my main template group.

    Also, on the second to last line, I have to add names of url segments that I want to allow…

    For example:

    http://www.site.com(removed index.php and template group “home”)/entry/blah/blah/

    Or

    http://www.site.com(removed index.php and template group “home”)/categories/blah/

    Hope that helps.

    Micky

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases