.htaccess Rewrite Out A Double Period

Viewed 54

We received some press coverage a few months back, but they mistyped our link as <a href="http://www..oursite.org/" target="_blank" data-component="externalLink">

They're a significant outlet and not interested in responding to our request to correct this typo, so we're trying to redirect it on our side. Is the below rule viable or, if not, is this something that we can resolve at all?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.\.oursite\.org
RewriteRule .* https://www.oursite.org [R=301,L]
1 Answers

I'm very sorry but you can't do this with htaccess. The problem is that the request http://www..oursite.org never hit your server, and therefor you can't do any redirect.

The Domain www..oursite.org has an invalid syntax, so you also can't configure a sub-domain www..oursite.com on your DNS server that points to your Web server and than catch the request and do some redirect.

So the only way is to fix the original link.

Related