Htaccess override wordpress setting to use CI controllers ??

Discussion in 'Apache' started by 123GoToAndPlay, Mar 1, 2010.

  1. #1
    Hi,

    Really could use some help. I am currently testing the following setup

    WordPress in root
    -Codeigniter in a subfolder

    My questions:

    1/ WP needs this htaccess
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /projectz/domain.coml/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /projectz/domain.com/index.php [L]
    </IfModule>
    
    Code (markup):
    But now i need to override the WP rules for the following url's and their subfolder, variables, seo urls:

    
    projectz/domain.com/jobs/................anything
    projectz/domain.com/profile/.........anything
    
    Code (markup):
    I want those url's to be redirect to something like
    
    projectz/domain.com/ci-folder/index.php 
    or projectz/domain.com/ci-folder/ 
    or projectz/domain.com/ci-folder/controller-name
    
    Code (markup):
    I like to be able to use nice SEO url's

    Is this possible and how?

    2/ Codeigniter uses his own htaccess to get rid of ci-folder/index.php and to prevent double content.
    Should i make any changes to this htaccess as well??
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /projectz/domain.com/ci-folder   #don't know for surs
    
        ### Canonicalize codeigniter URLs
        ### http://farinspace.com/2009/06/codeigniter-htaccess-file/
        ### http://codeigniter.com/forums/viewthread/136195/
    
        # If your default controller is something other than
        # "welcome" you should probably change this
        #RewriteRule ^(main(/index)?|index(\.php)?)/?$ / [L,R=301]
        RewriteRule ^(main(/index)?|index(\.php)?)/$ / [L,R=301]
        RewriteRule ^(.*)/index/?$ $1 [L,R=301]
    
        # Removes trailing slashes (prevents SEO duplicate content issues)
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.+)/$ $1 [L,R=301]
    
    
        #Removes access to the system folder by users.
        #Additionally this will allow you to create a System.php controller,
        #previously this would not have been possible.
        #'system' can be replaced if you have renamed your system folder.
        RewriteCond %{REQUEST_URI} ^system.*
        RewriteRule ^(.*)$ /index.php?/$1 [L]
    
        #Checks to see if the user is attempting to access a valid file,
        #such as an image or css document, if this isn't true it sends the
        #request to index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>
    
    <IfModule !mod_rewrite.c>
        # If we don't have mod_rewrite installed, all 404's
        # can be sent to index.php, and everything works as normal.
        # Submitted by: ElliotHaughin
    
        ErrorDocument 404 /index.php
    </IfModule> 
    
    Code (markup):
    Further more Codeigniter uses a routes.php by which you can redirect incoming links to specific controllers. Would routes.php still be usable??


    3/ can htaccess kill $_SESSIONS per subfolder??

    kind regards,
     
    123GoToAndPlay, Mar 1, 2010 IP