views:

36

answers:

1

I have a shared hosting plan with HostGator and multiple CI installations. For each installation, I've been able to successfully remove the "index.php" from the URL, but on my addon domain, none of my CSS, or JS, or image files load correctly.

Here is what I have for mod rewrite on the main domain:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

And for my addon domain, I have this:

RewriteEngine On
DirectoryIndex index.php
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

The add-on domains are located at /public_html/domain.com/.

I haven't been able to modify anything that doesn't give me an Internal Server Error, 500.

Any ideas?

+1  A: 

This is how I set it up to avoid the css not loading due to the rewrite. Hope it helps.

Add a folder in the document root for CI called assets. It's the folder where your system folder resides. Put all your scripts, css, images, etc in the assets folder.

Folders:
    >CI Root
    >>assets
    >>>CSS
    >>>Scripts
    >>>Images

Then allow requests for assets to bypass index.php in the .htaccess file:

    RewriteEngine on 
    RewriteCond $1 !^(index\.php|images|assets|robots\.txt) 
    RewriteRule ^(.*)$ /index.php/$1 [L]
JMC
Wasn't exactly what I needed but your answer put me on the right path and I was able to modify the rewrite so it works. Thanks!
tchaymore