CodeIgniter Forums
mod_rewrite with subdirectories - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: mod_rewrite with subdirectories (/thread-9366.html)



mod_rewrite with subdirectories - El Forum - 06-23-2008

[eluser]dexter21[/eluser]
Hi, i want to redirect a web that i have in

http://www.domain.com/elek/index.php/home

first at all , the server has only a .htaccess on root web directory , how could i redirect this url to http;//www.domain.com/elek/home ?

i've tried with:

Code:
RewriteEngine on
RewriteRule ^elek(.*)$ /elek/index.php/$1 [L]


but nothing happened.

i cant use " RewriteBase /elek " because this affect to other rules

Many thanks


mod_rewrite with subdirectories - El Forum - 06-23-2008

[eluser]marcoss[/eluser]
You have to set the sub-folder as your RewriteBase, like this:

Code:
RewriteEngine On
    RewriteBase /sub/folder/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]