U Upload3R Active Member 199 2010 22 0 Oct 16, 2011 #1 Hi lads! Can anyone tell me what is the most correct redirect code from WWW to non-WWW? Site powered by DLE. Thanks!
Hi lads! Can anyone tell me what is the most correct redirect code from WWW to non-WWW? Site powered by DLE. Thanks!
H hatem20 Active Member 1,458 2009 79 5 Oct 16, 2011 #3 Add this inside .htaccess Code: RewriteEngine On RewriteCond %{HTTP_HOST} ^[COLOR=Red]yourdomain[/COLOR].[COLOR=Blue]com[/COLOR] RewriteRule (.*) http://[COLOR=Red]yourdomain[/COLOR].[COLOR=Blue]com[/COLOR]/$1 [R=301,L] Also edit 'Site url' in Admin Panel.
Add this inside .htaccess Code: RewriteEngine On RewriteCond %{HTTP_HOST} ^[COLOR=Red]yourdomain[/COLOR].[COLOR=Blue]com[/COLOR] RewriteRule (.*) http://[COLOR=Red]yourdomain[/COLOR].[COLOR=Blue]com[/COLOR]/$1 [R=301,L] Also edit 'Site url' in Admin Panel.
T Traffic New Member 2 2011 2 0 Oct 16, 2011 #4 Guy that posted code above has good recomendation, you just need to edit .htaccess file and you are good to go.
Guy that posted code above has good recomendation, you just need to edit .htaccess file and you are good to go.
D Drinkordie Active Member 2,167 2010 660 0 Oct 16, 2011 #5 If you have Cpanel you can also use "Redirects" option - just setup 301 redirect. You dont need to edit htaccess then ... ; )
If you have Cpanel you can also use "Redirects" option - just setup 301 redirect. You dont need to edit htaccess then ... ; )
U Upload3R Active Member 199 2010 22 0 Oct 16, 2011 #6 Thanks lads! I actually googled it but I found many variants I just wanted to know which one is better.
Thanks lads! I actually googled it but I found many variants I just wanted to know which one is better.