Redirect Url on Htaccess |
The Htaccess file is actually the name of the Apache file configuration located on every level of the folder. All code in Htaccess is a command for that folder including sub-
The 301 redirect method is the best and fastest method for server configuration. The web server will check the Htaccess file before loading the web page, so if the server does a 301 redirect page then the page will be visible faster. Search Engines also use a 301 redirect to find where new pages are placed.
Here
Redirect One Specific Page
Example: redirect 301 /webpage.html http://www.domain.com/xxx.html
The above code will redirect one page to another.
Redirect Domain Name
Example: redirect 301 / http: //www.domain.com
The above code is used to redirect the domain. Suppose you have a domain http://aris.com who wants to be directed to the new domain http://fikri.com then you should put the above code on the root folder http://aris.com domain. If any visitor to the address http://aris.com it will soon be transferred to the domain http://fikri.com.
Redirect domain.com to http://www.domain.com
RewriteEngine On
Options + FollowSymLinks
RewriteCond% {THE_REQUEST} ^ [A-Z] {3, 9} \ /
RewriteRule ^ index \ .php / $ 1 [R-301, L]
Redirect domain.com to domain.com/folder/
RewriteEngine On
RewriteRule ^ $ / blog / [R = 301]
The above code will perform a 301 redirect to a specific folder. This code is commonly used to redirect visitors to another page when index.html on root is in repair. Can also be used if you make a mistake installation of blog or e-commerce on