I am using Cakephp 2.0, and my website’s domain name is www.sample.com. If I try to access sample.com (without www), his visit to www.sample.com will be great. But my problem is that my domain consists of a large number of pages for example:
> http://www.sample.com/users/login > http://www.sample.com/users/add
If I access the above URL, for example http://sample.com/users/login , it redirects to
> http:
but he needs to redirect to
http:
I already wrote the following .htaccess code (in front of the application folder) to redirect
Rewritecond %{http_host} ^sample.com [NC] Rewriterule ^(.*)$ http://www.sample.com/$1 [R=301,NC]
Inside the webroot folder, I have one .htacces file that contains the following code Perhaps this is a problem, I think
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
source share