Topics Search

.htaccess

Home » .htaccess (76)
  • Page 1 of 4
  • »
 

How to Redirect an Old Domain to New Domain via htaccess 301

How to Redirect an Old Domain to New Domain via htaccess 301 Icon
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.
 
Advertisement:
 

How to redirect from non-secure (HTTP) to secure (HTTPS) call?

How to redirect from non-secure (HTTP) to secure (HTTPS) call? Icon
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.
 

Password Protect Website Directory Using .htaccess File

Password Protect Website Directory Using .htaccess File Icon
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.
 

Apache Redirect HTTP to HTTPS

Apache Redirect HTTP to HTTPS Icon
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.
 

How to enable GZIP Compression for web page speed

How to enable GZIP Compression for web page speed Icon
This tutorial will explain about GZIP Compression for our website. As we know that compression means to compress the file size. So the loading time of web page is fast. Compression permits our web server to supply smaller file sizes that load quicker for your web site users. We can compress our static files like HTML, CSS and javascript with gzip that can save our bandwidth upto sixty to seventy percent of the actual file size. This means that it takes less time to load our web pages.
 

Redirection : 301, 302 and 307 redirection tutorial

Redirection : 301, 302 and 307 redirection tutorial Icon
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.
 

Mod_Rewrite Variables Cheatsheet

Mod_Rewrite Variables Cheatsheet Icon
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.
 

PhpMyAdmin Shortcuts with .htaccess

PhpMyAdmin Shortcuts with .htaccess Icon
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.
 

Showing Alternate robots.txt files with Htaccess Rewrites

Showing Alternate robots.txt files with Htaccess Rewrites Icon
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!
 

Htaccess Rewrite to redirect Uppercase to Lowercase

Htaccess Rewrite to redirect Uppercase to Lowercase Icon
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...
 

Setting charset information in .htaccess

Setting charset information in .htaccess Icon
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.
 

How to enable data compression using the mod_deflate module

How to enable data compression using the mod_deflate module Icon
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.
 

How To Optimize Your Site With GZIP Compression

How To Optimize Your Site With GZIP Compression Icon
Compression is a simple, effective way to save bandwidth and speed up your site. I hesitated when recommending gzip compression when speeding up your javascript because of problemsinolder browsers. But it’s the 21st century. Most of my traffic comes from modern browsers, and quite frankly, most of my users are fairly tech-savvy. I don’t want to slow everyone else down because somebody is chugging along on IE 4.0 on Windows 95. Google and Yahoo use gzip compression. A modern browser is needed to enjoy modern web content and modern web speed — so gzip encoding it is. Here’s how to set it up.
 

Better Default Directory Views with HTAccess

Better Default Directory Views with HTAccess Icon
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.
 

Redirecting Subdirectories to the Root Directory via HTAccess

Redirecting Subdirectories to the Root Directory via HTAccess Icon
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.
 

How To Block Bad Bots With .Htaccess And Php

How To Block Bad Bots With .Htaccess And Php Icon
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.
 

Top 10 Tips and Tricks

Top 10 Tips and Tricks Icon
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.
 

mod_rewrite Tutorial for Absolute Beginners

mod_rewrite Tutorial for Absolute Beginners Icon
Explains what mod_rewrite is and how to use it. Includes 3 practical examples: 301 redirects, creating friendly URLs, and blocking image hotlinking (leeching).
 

Password Protecting Your Pages

Password Protecting Your Pages Icon
Learn how to use Apache's .htaccess files to protect pages on your site with a username and password.
 

Making a Custom Error Page

Making a Custom Error Page Icon
In this tutorial we'll show you how you can display attractive error pages for your site's visitors instead of the ugly defaults.
Home » .htaccess (76)
  • Page 1 of 4
  • »