stergos Posted February 19, 2011 Posted February 19, 2011 Hello my problem is that my website http://www.e-hacking.com/ and http://e-hacking.com/ link my page the same. I want to use only http://www.e-hacking.com/ because I don't receive data from webmasters for non-www domain. Is there anyway to solve this problem? Thank you very much for any help! Quote
Byron Posted February 19, 2011 Posted February 19, 2011 Then you do want to use that code Wizard posted in the other thread you posted in. Use this to redirect all requests to your www: RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] Quote
stergos Posted February 19, 2011 Author Posted February 19, 2011 Then you do want to use that code Wizard posted in the other thread you posted in. Use this to redirect all requests to your www: RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] Thanks for reply! I have 21 pages I have to do this to all pages to the same .htacces? RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com/about.html RewriteRule (.*) http://www.e-hacking.com/about.html$1 [R=301,L] like this? Quote
Byron Posted February 19, 2011 Posted February 19, 2011 You only need to add it ONCE to your root .htaccess file. If you don't already have an .htaccess file then you need to create one, but I'm pretty sure you should already have one. Only this code: RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] Quote
stergos Posted February 19, 2011 Author Posted February 19, 2011 You only need to add it ONCE to your root .htaccess file. If you don't already have an .htaccess file then you need to create one, but I'm pretty sure you should already have one. Only this code: RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] I have one with this details: text/x-generic .htaccess ASCII text # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName e-hacking.com AuthUserFile /home1/stergos/public_html/_vti_pvt/service.pwd AuthGroupFile /home1/stergos/public_html/_vti_pvt/service.grp So after this i fill: RewriteEngine On RewriteCond %{HTTP_HOST} ^e-hacking.com RewriteRule (.*) http://www.e-hacking.com/$1 [R=301,L] sorry im newbie.... Quote
stergos Posted February 19, 2011 Author Posted February 19, 2011 Yes, that will work. Thank you very very much for your time I will try it right now. I was lose my mind with that last days, thank you again!!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.