Sunday, January 4, 2015

htaccess : Redirect URL (Permanent)

Redirects allow you to redirect a specific page to another page and display the contents of that second page. You can use this method to make a page that has a long URL accessible through a page with a shorter and easier-to-remember URL.

This is just some basic htacess for 301 redirecting URL from non-www and www to blog as example, just modify it as your need from here.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^kriptonium\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.kriptonium\.com$
RewriteRule ^/?$ "http\:\/\/blog\.kriptonium\.com\/" [R=301,L]

P/s : If you have CPANEL, just use Redirects function, they will create htaccess for you.

No comments:

Post a Comment