.htaccess for Codeigniter in Wordpress subfolder


/ Published in: Other
Save to your folder(s)

Try to run Codeigniter in a subfolder of a Wordpress installation and want to remove index.php for clean URLs?

Put this code in a .htaccess file in your codeigniter directory ("cidir" in this example).


Copy this code and paste it in your HTML
  1. <IfModule mod_rewrite.c>
  2. RewriteEngine On
  3. RewriteBase /cidir
  4. RewriteCond $1 !^(index\.php|images|robots\.txt)
  5. RewriteCond %{REQUEST_FILENAME} !-f
  6. RewriteCond %{REQUEST_FILENAME} !-d
  7. RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
  8. </IfModule>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.