[eluser]kane.zach[/eluser]
[SOLVED: Aha, I got this last evening after finding someone else using shared hosting. I had written off the guide's advice since I figured that was specific to an implementation. Turns out, in addition to index, robots & directories I needed to add 'public'. Not sure if this is necessary to all shared host setups but that's what resolved it all for me.]
Hello all,
I know this is a ridiculous topic that gets brought up/asked a lot but I cannot for the life of me set my .htaccess right for my newest setup.
I'm on shared hosting so I can't put things in certain directories just based on my service but this shouldn't be too complicated (right?)
I have my domain.com and in CPanel I've made a subdomain. So the structure looks like this now:
Code:
www
Main CI install and website files
index.php
.htaccess
sub
This new CI install files
index.php
.htaccess
I have controllers and whatnot working and now just trying to clean up the URLs. I set the config file index_file to ''; and I know mod_rewrite is on the server because I got things working in the main install.
Here's what I got in the sub .htaccess now with no luck:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
# Prevents image/flash hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?sub.domain.net/.*$ [NC]
RewriteRule \.(gif|jpg|png|swf|flv)$ /feed/ [F]
</IfModule>
(modified the last url there because the site isn't live =) but I assure you it's proper.) Should ReWrite Base be something different since it is a subdomain? I don't know but I feel like a fresh pair of eyes might see something.
Thanks in advance & I'll get back to trying!