Hello I try to redirect my domain name from non-www to www via .htaccess file. My previous htaccess code was
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
I replace it by the code
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.forexfunction\.com
RewriteRule (.*) http://www.forexfunction.com/$1 [R=301,L]
but i face 404 errors after replacing this code. How can i solve my problem? Thanks in advance.
This is the code which will redirect non-www request to www request.
Here is how you .htacccess file will look like.
Hope it helps.