Create an .htaccess file in your public_html directory with the following code: RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www.)?domain.com.*$ [NC] RewriteRule .(gif|jpg)$ – [F] Where domain.com is your domain.
Tag: .htaccess
How to forward a website to another url
There are several ways to accomplish this task, but the simplest to understand is to use php. To do this, you need to create the page that will do the forwarding. This can be any page, as long as it ends in “.php”. If you are trying to redirect a domain, you’d create “index.php” inside… Continue reading How to forward a website to another url
Redirect domain.com to www.domain.com
If you want to force clients to use www.domain.com, you can redirect them from domain.com to the www version with an .htaccess file. In your public_html folder, create a file called .htaccess and add the code: RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent] where you’d need to replace domain\.com and domain.com with your actual domain name. Note the \ character must… Continue reading Redirect domain.com to www.domain.com