how_to_fix_redirect

My domain is redirected to another URL/site/server how to fix it?


Introduction


Redirection from one URL to another may be implemented in several layers:
  • web-server configuration file - i.e .htaccess and lighttpd.conf
  • HTML level redirection - i.e <meta http-equiv="Refresh" .../> tag level
  • JavaScript level redirection - i.e window.location object "window.location = 'http://another-domain.name/'

Quttera's web malware solutions detect all these threats. In order to check your domain online for HTML, JavaScript and other kinds of traffic redirects with Website Malware Scanner submit your domain here

In general, web-server configuration files are not (SHOULD NOT) be accessible from remote server thus WIS might not be able to detect redirections of the first type(web-server configuration file based).

Following are few examples of rules implemented to redirect visitors browser from one URL to another using web-server configuration file.


My website is hosted on apache web-server


Redirection using .htaccess file


Look for similar rules:

Pure redirection
Redirect 301 / http://another-site.name/ 
Redirection of a specific file to another web-site
Redirect /index.html http://another-site.name/index.html
Modifications to index file
DirectoryIndex index.html

Redirection using .htaccess rewrite rules


The Apache module mod_rewrite provides regular-expression based parser used to rewrite URL requests.
In some cases mod_rewrite is used to redirect request from one destination to another. Iterate over your .htaccess file and look for lines starting from "RewriteRule" word.

Following some examples of mod_rewrite rules:

Redirect from one folder to specific folder on another-site.name
RewriteRule ^folder1.* http://another-site.name/folder/ [R=301,L]
Redirect access to anyfile to http://another-site.name/folder/
RewriteRule ^(.*) http://another-site.name/folder/1 [R=301,L]


My website is hosted on lighttpd web-server


Redirection using lighttpd.conf file


Configuration rules supported by lighttpd provide possibility to redirect HTTP request from one destination to another using url.redirect rule: url.redirect = <regular-expression> => <new-target>

Examples of rules that could be used for this purpose:

Redirect requests to "http://www.domain.name" to "http://domain.name"
                ["host"] =~ "^www\.(.*)"
                {
                    url.redirect = ( "^/(.*)" => "http://%1/1" )
                }
Redirect request to "http://mydomain.name" to "http://www.another-domain.name"
                ["host"] =~ "^mydomain\.name"
                {
                    url.redirect = ( "^/(.*)" => "http://www.another-domain.name/1" )
                }

Examples from Quttera's blog


Malicious redirection detected by Quttera's online Website Malware Scanner


  • Malicious redirection

    HTTP redirection detection

    Malicious HTTP redirection to web site hosting malware. These and other malicious redirections are detectable by online Website Malware Scanner.

    Read more... Other posts on malware

Malware clean-up

For WordPress based websites this kind of malware is often hidden in the .htaccess file. If your website was infected by similar malware and you need help please use Website Anti-malware Monitoring for remediation assessment.