I'm currently having a lot of struggle setting up this very simple .htaccess on my website.
RewriteEngine On
RewriteCond %{REQUEST_URI} !/page
RewriteRule (.*) webroot/$1
RewriteCond %{REQUEST_URI} /page
RewriteRule (.*) pageroot/$1
I think the code is self-explanatory. I don't know why but when there is /page in my url, it still get redirected to webroot. Thanks a lot..
Your answer is right but it still doesn't work because indeed I have anoter .htaccess file in my page folder. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.*) /index.php?/$1 [L] – Laurent Meunier Feb 16 '15 at 14:57
I'm now getting an 'The requested URL /page was not found on this server.' error. The page .htaccess is in the pageroot folder, I have no page folder. When I said page folder I meant pageroot folder – Laurent MeunierFeb 16 '15 at 15:08
Well sorry for the imprecision, I was reffering to the folder containing my page files, which is actually named pageroot – Laurent Meunier Feb 16 '15 at 15:13
ok check updated code for
/pageroot/.htaccess
– anubhava Feb 16 '15 at 15:241
Yhea okay thanks – Laurent Meunier Feb 16 '15 at 15:34