I am sure there is a simple 1-3 lines of code in httpd.conf that can do that. Instead when Googling for the answer, I keep seeing a long essays about 301 redirects but no real-world workable solution!
It’s like everyone wants to write a long article about it, probably for seo purposes but nobody wants to just say, here, this is how you do it:… done!
Can someone please just tell me the what to add to httpd.conf
I tried this one
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
but then when someone what typing www.qod.tw
it was redirecting to www.qod.tw//
It was adding an extra / at the end
and when typing www.qod.tw/make
it was redirecting to http://qod.tw//make
another extra slash.
I just changed that rule to
RewriteRule ^(.*)$ http://qod.tw$1 [R=301,L]
Did you bother to look at the sticky threads? Did you bother to look at the tutorial linked in my signature? The code is there! Sorry, I get SO frustrated at the lack of “minimal effort” by posters asking simple questions.