I have recently set a new URL http://www.mytechnotes.biz for a blog I was maintaining on a subdomain http://technotes.tostaky.biz.
The redirection works in the following cases:
technotes.tostaky.biz -> www.mytechnotes.biz
www.technotes.tostaky.biz -> www.mytechnotes.biz
But it does not work in this case:
http://technotes.tostaky.biz/2012/11/introduction-to-css-concepts.html
Yet, the following page exists:
www.technotes.biz/2012/11/introduction-to-css-concepts.html
The content of my .htaccess
file is:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^technotes\.tostaky\.biz$ [OR]
RewriteCond %{HTTP_HOST} ^www\.technotes\.tostaky\.biz$
RewriteRule ^/?$ "http\:\/\/www\.mytechnotes\.biz\/" [R=301,L]
I am not a sysadmin. I am relying on CPanel configuration of my host, but I can't resolve this issue. Anyone knows how to solve it? Thanks!
The pattern (thing that gets matched) in your RewriteRule,
^/?$
, explicitly only matches the root URL of the domain. I think what you want is to match anything, and include it in the redirected URL: