Welcome Guest, Not a member yet? Register   Sign In
rename index.php and working with CI CMS?
#1

[eluser]Zeeshan Rasool[/eluser]
hi all CI lovers..
i've a problem. i need to put cms that is in CI and my site that is developed in plain php
so im using same folder in which i put my system folder and my site's pages etc. So how can i use same .htaccess so that when i give http://mysite.com/cms it loads cms and if i use http://mysite.com then it loads my site.

RewriteEngine on
Code:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex admin.php

RewriteCond $1 !^(admin\.php|tmp|images|css|js|robots|css|tiny_mce|images|cms_js\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ admin.php?$1 [L,QSA]



RewriteRule ^index.html$ index.php
RewriteRule ^my-studio.html$ my-studio.php?p=my-studio
in cms case it loads cms but site cant' be accessed
thnx
#2

[eluser]Phil Sturgeon[/eluser]
Just put cms into the first RewriteCond

Quote:RewriteCond $1 !^(admin\.php|cms|tiny_mce|cms_js\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ admin.php?$1 [L,QSA]

Means it will not try and match anything starting with "cms" to CodeIgniter.

Btw, I took out lots of the first line as it wasn't required. They match against real files so the 2nd and 3rd conditions pick that up. No point in having it check 11 things EVERY request that is made.




Theme © iAndrew 2016 - Forum software by © MyBB