Welcome Guest, Not a member yet? Register   Sign In
Codeigniter .htaccess redirect
#1

I don't understand how can this work and the later doesn't... If I have a .htaccess on my root:

Code:
RewriteEngine on
RewriteBase /

ReWriteCond %{REQUEST_URI} !public/
ReWriteRule ^(.*)$ public/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]

and my index in root/public/index.php everything works fine when I enter my URL (localhost). Page redirects finds my index and deletes a part of URL. 

But if I relocate everything in another file root/en and throw .htaccess file in there:


Code:
RewriteEngine on
RewriteBase /

ReWriteCond %{REQUEST_URI} !en/public/
ReWriteRule ^(.*)$ en/public/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?/$0 [PT,L]

it just doesn't want to redirect to root/en/public/index.php when I type localhost/en... I get "The page you requested was not found."
Reply




Theme © iAndrew 2016 - Forum software by © MyBB