1. Why do you need RewriteCond
here that does absolutely nothing?
2. Target URL should be just normal link -- no need to escape all non-alphabet characters like you do \:\/\/
.
3. That directive requires mod_rewrite module to be enabled on your server.
That's how your rule should look like:
RewriteEngine On
RewriteRule ^domian_registration\.html$ http://mysite.com/domain_registration.html [R=301,L]
OR as simple as (although including full domain name in URL is recommended):
RewriteEngine On
RewriteRule ^domian_registration\.html$ domain_registration.html [R=301,L]
If you do not have mod_rewrite enabled on your site, you can use this directive instead:
RedirectMatch 301 ^/domian_registration\.html$ http://mysite.com/domain_registration.html
UPDATE: This is an answer for your additional question:
RewriteCond %{QUERY_STRING} ^id=(\d+)
RewriteRule ^maghalat\.php/isfahan_articles(\d+)\.html$ /articles/isfahan_articles$1.html? [R=301,L]
This rule will redirect /maghalat.php/isfahan_articles123.html?id=123
to /articles/isfahan_articles123.html
.
Considering that source and target URLs are very similar .. and the fact that id in html file name is the same as id=
parameter in query string, we can ignore the query string thus making the rule a bit simpler (no real need for RewriteCond
line):
RewriteRule ^maghalat\.php/isfahan_articles(\d+)\.html$ /articles/isfahan_articles$1.html? [R=301,L]