HTACCESS file doesent work in sub-folder |
[eluser]yNaxon[/eluser]
hello, I am using the htaccess code that was given in codeigniter's user guide: Code: RewriteEngine on it only works if the installation is located in the root directory. if it's located in a sub-folder, it doesen't work. any idea how to make it work also under sub-category? thanks
[eluser]Aken[/eluser]
Code: RewriteEngine On
[eluser]yNaxon[/eluser]
thank you very much for replying, but the problem is not solved. I still can't access any controller, it gives me an error. if I try to import a css file, and using the next address: example.com/subfolder/css/css.css it redirects me to: example.com/subfolder/example.com/subfolder/css/css.css but if I add http://www, it works.
[eluser]InsiteFX[/eluser]
Thats because each CodeIgniter folder has its own .htaccess file. The one you are trying to use should be placed in the root with index.php Here is a correct .htaccess file: Code: php_value default_charset utf-8
[eluser]yNaxon[/eluser]
would you explain how it works? how does it recognize when to redirect and when not to?
[eluser]blekknajt[/eluser]
Assuming that CodeIgniter is in ci-folder - this one works for me: Code: RewriteEngine on added: As it was said in first answer. You must add CSS and other folders to RewriteCond if You don't want them to be treated by RewriteRule.
[eluser]yNaxon[/eluser]
thank you very much!! but now there's a problem: if I give a link from the view file to external source: <a > it links to: http://www.example.com/http://www.anotherexample.com/
[eluser]blekknajt[/eluser]
If this is true, .htaccess is don't responsible for that. |
Welcome Guest, Not a member yet? Register Sign In |