.htaccess 301 Redirect Generator

A simple .htaccess 301 redirect generator to be used to create SEO friendly permanent redirects.
For more advanced rules you can visit our .htaccess RewriteRule Examples.


Redirect old domain to new domain

Old Domain   

New Domain 




Redirect to www

Domain 




Redirect old directory to new directory

Old Directory   

New Directory 




Redirect old URL to new URL

Old URL   

New URL 

Was this answer helpful?

Also Read

Redirect non-www to www over http and https

Use the following .htaccess code to redirect non-www URLs to www over http and https. Create, or...

Disabling Magic Quotes GPC

How to turn off magic quotes gpc (required by Joomla 3 and some other scripts).1. Create a...

Secure Joomla with .htaccess

Advanced .htaccess rules that will overall secure and increase the speed of your Joomla...

Point your home page URL to a subdirectory

Method 1 - Redirect your main domain to a subfolder on that domain: RewriteEngine On# Change...

Resolving XMLRPC DDoS WordPress Attack with .htaccess

Brute Force Attacks against WordPress have always been very common.Here is how to temporarily...