htaccess help in coexisting Codeigniter and Wordpress install

前端 未结 3 1939
春和景丽
春和景丽 2021-01-16 05:15

My intention here is to have a codeigniter app with a blog under the same domain. The admin for both should be separate.

The directory structure is this:

<         


        
3条回答
  •  囚心锁ツ
    2021-01-16 05:56

    I generally use 2 sets of conditions on the CI .htaccess (one on the root folder)

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^blog/(.*)$ blog/index.php [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    

    This will allow the processing of blog URLs first and then deal with the CI URLs. You need to be careful not to have any controllers or routes using the term blog in your application.

提交回复
热议问题