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.

index.php and template group removal

January 20, 2010 3:09pm

Subscribe [0]
  • #1 / Jan 20, 2010 3:09pm

    auchumilk

    6 posts

    Apparently paid support can’t be bothered, maybe the someone in the community can help.

    I’m trying to remove index.php and the template group from the url and spent yesterday, last night and today doing so. Recently started clearing cache in Firefox after each trial. Not sure if there are cache issues. For some reason I’m getting a redirect to http://localhost/xampp with the majority of these .htaccess files. It was not doing so earlier yesterday.

    My current setup:


    http://localhost/Expression/myTemplate/Events
    http://localhost/Expression/myTemplate/

    $config['uri_protocol']    = 'AUTO';
    $config['index_page'] = "";
    $config['base_url'] = "http://localhost/Expression/";


    D:\Install\Xampp\xampp\apache\conf\httpd.conf
    LoadModule rewrite_module modules/mod_rewrite.so

    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/Install/Xampp/xampp/htdocs"
    
    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories). 
    #
    # First, we configure the "default" to be a very restrictive set of 
    # features.  
    #
    <Directory >
        Options FollowSymLinks
        AllowOverride ALL
        Order deny,allow
        Deny from all
    </Directory>
    
    #
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    #
    
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/Install/Xampp/xampp/htdocs">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # <a href="http://httpd.apache.org/docs/2.2/mod/core.html#options">http://httpd.apache.org/docs/2.2/mod/core.html#options</a>
        # for more information.
        #
        Options Indexes FollowSymLinks Includes ExecCGI
    
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
        Order allow,deny
        Allow from all
    
    </Directory>
    #


    D:\Install\Xampp\xampp\htdocs\Expression\.htaccess
    .htaccess used with variety of different ‘uri_protocol” from config.php

    #“Include” List Method
    # Brings me to <a href="http://localhost/xampp/">http://localhost/xampp/</a>
    
    RewriteEngine on
    RewriteCond $1 ^(index|Events|myTemplate|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L] 
    
    ------------------------------------------------------------
    
    #“Exclude” List Method
    # Brings me to <a href="http://localhost/xampp/">http://localhost/xampp/</a>
    
    RewriteEngine on
    RewriteCond $1 !^(images|system|themes|favicon\.ico|robots\.txt|index\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L] 
    
    
    ------------------------------------------------------------
    
    #Generate .htaccess for “Include” List Method Manually with the weblog:entries tag
    #inserted to a new template in EE2 and not .htaccess
    
    RewriteEngine On
    
    RewriteCond $1 ^(member|{exp:query sql="SELECT group_name FROM exp_template_groups"}{group_name}|{/exp:query}P[0-9]{2,8}) [NC]
    
    RewriteRule ^(.*)$ /index.php/$1 [L] 
    
    ------------------------------------------------------------
    #“File and Directory Check” Method
    
    RewriteEngine On
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    ------------------------------------------------------------
    #“File and Directory Check” Method
    # with ?
    
    RewriteEngine On
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    ------------------------------------------------------------
    
    #Removing from subdirectory
    # 'AUTO'        
    # 'PATH_INFO'        removes css
    # 'QUERY_STRING'    removes css
    # 'REQUEST_URI'        removes css
    # 'ORIG_PATH_INFO'    removes css
    
    RewriteEngine On
    RewriteBase /
    
    # Allow calls to css files
    # causes an error 
    # RewriteCond %{QUERY_STRING} ^(css=.*)$ [NC]
    
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^myTemplate/?(.*)$ /Expression/$1 [R=301,L]
    
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /Expression/index.php/myTemplate/$1 [L]  
    
    -------------------------------------------------------------
    
    #Removing Template Group and index.php from URL
    
    RewriteEngine On
    RewriteBase /
    
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^myTemplate/?(.*)$ /$1 [R=301,L]
    
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/myTemplate/$1 [L] 
    
    
    ================================================================
    
    RewriteEngine On
    
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^myTemplate/?(.*)$ /$1 [R=301,L]
    
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/myTemplate/$1 [L]
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases