Securing your apache web server is one of the most important task, specially when you setting up a new website. For example, if you create a new website directory called “tecmint” under your Apache server (/var/www/tecmint or /var/www/html/tecmint) and forgot to place an “index.html” file in it, you may surprised to know that all your website visitors can get a complete listing of all your important files and folders simply by typing http://www.example.com/tecmint in the browser. In this article, we will show you how to disable or prevent directory listing of your Apache web server using .htaccess file.
Changing domain names can be scary and unfortunately, it’s quite common. When migrating to a new domain name, not only do you risk breaking all your pages and links, but Google can also get really cranky if all your indexed URLs end with a 404 – Page Not Found. Not only is this a terrible experience for your users, but it’s also a sure way to lose all your SEO juice aka Google Ranking. The good news is, if you’re running on an Apache website (which most of the internet is), there’s a simple solution.
If you want to setup SSL on your blog then follow this tutorial. For new blog it’s mainly straightforward to enable HTTPS but sometimes it’s not that straight for old and very mature blog. As you know, your blog links may be all of the places, like social media, other blogs, somebody’s bookmark, etc. Let’s take a look at below numbers under Links to Your Site section.
In this post we will learn how to easily secure your site’s directory using .htaccess file. Only users with valid credentials can access that directory/site. It’s the quickest and easiest way to protect directories/files in your site with password. It can also be used as a quick way to hide your site when its in maintenance or under construction.
Many of sites required to always running with ssl only. And we need to ensure that every use must access website through ssl. If any user tried to access website with non-ssl url, He must be a redirect to ssl website. This tutorial will help you to redirect website to ssl url each time using Apache mod_rewrite module.
Redirection is the process of forwarding one URL to a different URL. There are three main kinds of redirects: 301, 302, and meta refresh. A redirect is a way to send both users and search engines to a different URL from the one they originally requested. Below are descriptions of some of the commonly used types of redirects.
We've figured out what mod_rewrite variables look like so we can create rewrite rules and condition patterns based on the actual value. This cheatsheet is where we'll lay them all out for quick reference. This cheatsheet changed my life.
If you want http://server/phpMyAdmin/database[/table][/script] URL, you need to do some configuration. Following lines apply only for Apache web server. First make sure, that you have enabled some features within global configuration. You need Options FollowSymLinks and AllowOverride FileInfo enabled for directory where phpMyAdmin is installed and you need mod_rewrite to be enabled.
So here's the basic idea: There are 2 sites, a development site and a live site. They are essentially mirrors of each other in terms of they have the same files. You need to disallow all search engine robots from indexing and crawling the development site, while allowing full crawling of your live site. Htaccess to the rescue!
Want to redirect all links with any uppercase characters to lowercase using pure mod_rewrite within an .htaccess file? Sure why not! OR how to use RewriteMap and mod_speling for those with access to httpd.conf...
It is important to ensure that any information about character encoding sent by the server is correct, since information in the HTTP header overrides information in the document itself. Many Apache servers are configured to send files using the ISO-8859-1 (Latin-1) encoding. In the examples in this FAQ, we'll assume that you want to serve your file or files using a different encoding than that specified in the default configuration.
This article describes how to enable data compression by configuring Apache's mod_deflate module in an .htaccess file. You can use the Apache mod_deflate module to compress output from your web site that is sent to client browsers. Using data compression can reduce page load times and the amount of bandwidth your site uses.
Beautify your default directory listings! Displaying index-less file views is a great way to share files, but the drab, bare-bones interface is difficult to integrate into existing designs. While there are many scripts available to customize the appearance and functionality of default directory navigation, most of these methods are either too complicated, too invasive, or otherwise insufficient for expedient directory styling. In this comprehensive tutorial, you will learn how to use the built-in functionality of Apache’s mod_autoindex module to style and enhance your default directory views with a smorgasbord of stylistic and functional improvements.
One of the most useful techniques in my HTAccess toolbox involves URL redirection using Apache’s RedirectMatch directive. With RedirectMatch, you get the powerful regex pattern matching available in the mod_alias module combined with the simplicity and effectiveness of the Redirect directive. This hybrid functionality makes RedirectMatch the ideal method for highly specific redirection. In this tutorial, we will explore the application of RedirectMatch as it applies to one of the most difficult redirect scenarios: redirecting all requests for a specific subdirectory (or any subordinate directory or file) to the root (or any parent) directory. We will explore how to accomplish this redirect using PHP in a subsequent article.
In this tutorial, We'll learn how to block bad bots and spiders from your website using .htaccess and PHP. We can save bandwidth and performance for customers, increase security, and prevent scrapers from putting duplicate content around the web.
Creating custom documents gives your site a more professional look, as not only are you providing a 'net' to catch unsuspecting visitors. The top ten htaccess tips and tricks used by web developers.
Explains what mod_rewrite is and how to use it. Includes 3 practical examples: 301 redirects, creating friendly URLs, and blocking image hotlinking (leeching).
Learn how to use Apache's .htaccess files to protect pages on your site with a username and password.