Menu .htaccess
 

How to use the .htaccess file

The .htaccess file can be used for multiple uses on your server.

404 error handling

" ErrorDocument 404 /no_find.html "

Permament Redirect

The following was added to my .htaccess file and it works - not that I have a page with the name oldpage.html

" Redirect 301 /oldpage.html /index.html "

Banning referrers

The referrer that I would like to ban is Vitaly Popov - this was related to the referrer spam.

" ## SITE REFERRER BANNING
RewriteCond %{HTTP_REFERER} semalt.com [NC,OR] "

The above example presumably bans semalt.com

Top

Links

References: - a note on these

  • 1 - How To Stop Referrer Spam - https://raventools.com/blog/stop-referrer-spam/ - Feb 2015
  • 2 - Referral Spam - https://raventools.com/blog/remove-google-analytics-referral-spam/ - Jan 2017 update on above
  • 3 - rewrite syntax - ttps://httpd.apache.org/docs/2.4/rewrite/intro.html
  • 4 - rewrite flags - https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_r
  • 5 - OR Flag - https://stackoverflow.com/questions/12484814/or-flag-in-htaccess-mod-rewrite

Site design by Tempusfugit Web Design -