Run CI under Wordpress root directory |
Hi Guys,
I'm wondering if anyone came across with this issue. basically, under the root directory are Wordpress core files and folders. now, my CI project folder is also in the root. my problem is, i can't access my CI, since WP htaccess is overriding the CI (htaccess). the URL's are for example are: www.wp-project.com <-- Wordpress www.wp-project.com/ciproject <-- CI can anyone please help how. Thanks much in advanced.
Try adding at CI htaccess
Code: RewriteBase / and please post your htaccess's for both WP and CI so we can help you easier ![]() Best VPS Hosting : Digital Ocean
Have you in both directories a htaccess file? Normaly if you have also one in /ci/ it should be overwrite the one from the main site.
Hi Rufnex and sv3tli0,
here are the .htaccess for both. WP: this is in the main root directory (something, /var/www) # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress For CI: is on sub-folder (like: /var/www/ciproject/public_html) <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on # Send request via index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> and in config.php i set something like, $config['base_url'] = 'http://www.wp-project.com/ciproject/'; By the way, i'm not really familiar with .htaccess. hope you guys can further help. Thanks Again
You have to write your RewriteBase in the CI folders .htacces
Code: <IfModule mod_rewrite.c> This works for me.
@Rufnex, your second method partially work. like if i type http://www.wp-project.com/ciproject, it will bring me to page "index of /ciproject" with list links "parent directory" and "public_html". clicking "public_html" will bring me to the CI default controller "http://www.wp-project.com/ciproject/public_html/admin/users/login" (the "public_html/" part in the URL should be omited). once logged, i'm being brought to the dashboard page ("/ciproject/public_html/admin/dashboard").
the remaining issues now i think: - is how do i redirect user to default controller ("http://www.wp-project.com/ciproject/public_html/admin/users/login" without "public_html/" part) once type http://www.wp-project.com/ciproject - how to remove "public_html/" part in the url Hope you'll still be with me in this issue and thanks much for the response...
I dont understand excatly the problem. In the htaccess you have defined the RewriteBase. That is the base for your project.
RewriteBase /ciproject/public_html Just move all files from public_html to /ciproject and correct the RewriteBase to RewriteBase /ciproject should help you. |
Welcome Guest, Not a member yet? Register Sign In |