remove subdir from url - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: remove subdir from url (/showthread.php?tid=23843) |
remove subdir from url - El Forum - 10-23-2009 [eluser]jparent[/eluser] Hi I have my site, for example: "www.mydomain.com/ci_subdir" I removed the "index.php" from de url and now I move through the page like: "www.mydomain.com/ci_subdir/controller" That I want is to know what is the rewrite rule to make: "www.mydomain.com/controller/" Thanks! remove subdir from url - El Forum - 10-23-2009 [eluser]rogierb[/eluser] I guess something like Code: RewriteBase / remove subdir from url - El Forum - 11-04-2009 [eluser]jparent[/eluser] I try to explain better: that's my tree of directories htdocs/ |- myapp |-system |- ... //other folders from codeigniter |- .htaccess |- index.php The content of my .htaccess is that: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|img|img_public|css|js|\.txt|fckeditor|docs) RewriteBase / RewriteRule ^(.*)$ /myapp/index.php/$1 [L] but this code don't remove myapp from the url. It means that I write www.mydomain.com and it doesn't work. I need to type www.mydomain.com/myapp, and then it works. And that I want is to keep this folder structure and when I write www.mydomain.com it moves me to www.mydomain.com/myapp/ without change the url. And if I type www.mydomain.com/class/method moves me to wwww.mydomain.com/myapp/class/method Could any body tell me how I shoud do that? Thanks! remove subdir from url - El Forum - 11-04-2009 [eluser]rogierb[/eluser] The .htaccess should be in htdocs. remove subdir from url - El Forum - 11-04-2009 [eluser]jparent[/eluser] I'll try it and it doesn't work. remove subdir from url - El Forum - 11-04-2009 [eluser]rogierb[/eluser] A bit more information might be usefull. "it doesn't work" is kinda demoting. ok, there should be 2 .htaccess files, one in you root, the other one in your system folder The one in your root should have something like Code: RewriteBase / The one in your application folder something like Code: RewriteEngine On remove subdir from url - El Forum - 11-11-2009 [eluser]jparent[/eluser] Thank's it runs very good! Thank you very much for your detailed explanation! |