[eluser]jostster[/eluser]
I followed the directions here
http://ellislab.com/forums/viewthread/176636/ and am still having an issue. I have to have index.php in my url or else I will get the default_controller page. I have set my uri protocol to PATH_INFO and copy/pasted the .htaccess, however, it will not work unless I include index.php/path/to/goto into the uri.
I currently have a folder under my root directory which I am making this CI application to test it before it goes live.
mysite.com/ci/index.php
Here is the mysite.com/ci/.htaccess file
Code:
#<IfModule mod_rewrite.c>
# RewriteEngine on
# RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
# RewriteRule ^(.*)$ /ci/index.php/$1 [L]
#</IfModule>
<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 ^(.*)$ ci/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 ^(.*)$ ci/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 ^(.*)$ ci/index.php?/$1 [L]
RewriteRule ^(.*)$ ci/index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 ci/index.php
</IfModule>
Here is my system/application/config/config.php file
Code:
$config['index_page'] = "";
$config['uri_protocol'] = "PATH_INFO";
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\?\=\#\&\-';//'a-z 0-9~%.:_\-';
$config['enable_query_strings'] = FALSE;
Here is my routes
Code:
#Clothing
$route['clothing'] = "products/index/clothing";
$route['clothing/(:any)'] = "products/index/clothing/$1";
#Sponsor
$route['sponsor'] = "products/index/sponsor";
$route['sponsor/(:any)'] = "products/index/sponsor/$1";
I will also need to pass a variable in clothing sometimes that will be like
mysite.com/clothing/shirts?men
Inside my products.php controller I have
Code:
function __construct()
{
parent::__construct();
parse_str($_SERVER['QUERY_STRING'],$_GET);
}