CodeIgniter Forums

Full Version: mod_rewrite with subdirectories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi, i want to redirect a web that i have in

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

i've tried with:

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

El Forum

You have to set the sub-folder as your RewriteBase, like this:

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