.htaccess - Codeigniter installation in subdirectory -


i want install latest version of codeigniter in subdirectory. works far. want remove index.php url. therefore have .htaccess file in subfolder.

rewriteengine on rewritebase /dev/  # removes trailing slashes (prevents seo duplicate content issues) rewritecond %{request_filename} !-d rewriterule ^(.+)/$ $1 [l,r=301]  ###  # removes access system folder users. # additionally allow create system.php controller, # not have been possible. # 'system' can replaced if have renamed system folder. rewritecond %{request_uri} ^system.* rewritecond %{request_uri} ^application.* rewriterule ^(.*)$ /index.php/$1 [l]  # checks see if user attempting access valid file, # such image or css document, if isn't true sends # request index.php rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ /index.php/$1 [l] 

the name of subfolder dev , webroot (the parent folder) empty. there index.html file in it.

so resulting in structure:

/var/www/     index.html     dev/         ci installation here         .htaccess 

and of course mod-rewrite enabled.

any ideas why wont work? 404 error when calling http://domain.tld/dev/login

you need 2 things.

in config.php, configure index_page empty, urls created

$config['index_page'] = ''; 

and in .htaccess

rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^.*$ index.php/$0 

the access system , application directories prohibited .htaccess files in these subdirectories, delivered codeigniter.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -