I am having a big problem, I checked the redirection of my domain here http://www.redirectcheck.com/ then the result was
"http://domain.com/sub"
HTTP/1.1 301 Moved Permanently Date: Thu, 03 Mar 2011 07:14:30 GMT Server: Apache/2.2.3 (CentOS) Location: http://www.domain.com/sub/ Vary: Accept-Encoding Content-Length: 326 Connection: close Content-Type: text/html; charset=iso-8859-1
"http://www.domain.com/sub/"
HTTP/1.1 301 Moved Permanently Date: Thu, 03 Mar 2011 07:14:31 GMT Server: Apache/2.2.3 (CentOS) Location: http://domain.com/sub/ Vary: Accept-Encoding Content-Length: 322 Connection: close Content-Type: text/html; charset=iso-8859-1
"http://domain.com/sub/"
HTTP/1.1 200 OK Date: Thu, 03 Mar 2011 07:14:31 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Vary: Accept-Encoding Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8
I wanted it to be like this:
When I go to “http://domain.com/sub” (no trailing slash) it should redirect to “http://domain.com/sub/”
And when I go to “http://www.domain.com/sub” (no trailing slash) it should redirect to “http://domain.com/sub/”
Is it possible to do that?
Put the following into your document root
.htaccessfile:Be aware though that other entries in your
.htaccessfile are likely to interfere with this, so you may want to remove some other entries.