Codeigniter installation in subdirectory |
I want to install the latest version of codeigniter in a subdirectory. That works so far. But now I want to remove the index.php from the url. So therefore I have this .htaccess file in the subfolder.
RewriteEngine On RewriteBase /dev/ # Removes trailing slashes (prevents SEO duplicate content issues) RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301] ### # 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.* 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] The name of the subfolder is dev and the webroot (the parent folder) is empty. There is just an index.html file in it. So this is resulting in this structure: /var/www/ index.html dev/ ci installation here .htaccess and of course mod-rewrite is enabled. Any ideas why it wont work? I get an 404 Error when calling something like http://domain.tld/dev/login
What you need is to edit your CodeIgniter config.php in System > application > config.
and then edit config.php and set the property: $config['base_url'] = "http://www.domain.com/my_subfolder/"
Please also see app/Config/Paths.php
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |