Url Friendly Structure For Best SEO | htaccess
Url Friendly Structure For Best SEO | htaccess
[ popmake-pop01 ]
.htaccess : It is used for Url Structure
Rewrite and Redirect
.htaccess is the default name for a file that is used to indicate who can or cannot access the contents of a specific file directory from the Internet or an intranet. The .htaccess file is a configuration file that resides in a directory and indicates which users or groups of users can be allowed access to the files contained in that directory.
Rewrite:In this Type Url is rewrite help by htaccess .User build a command for Rewrite the Url in Other Related lines . these command execute in the server .
Rewite : www.nareshprajapat.com/founder/mr.zx.html
Redirect:In this Type Url is redirection help by htaccess .User build a command for Rewrite the Url in Other Related lines . these command execute in the server .
Ex: www.nareshprajapat.com/2018/04/1023565544/post.html
ReDirection : www.newsite.com/aboutus
Example of Rewrite :
Generated By : http://www.visiospark.com/mod-rewrite-rule-generator/
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.adlblastek\.com\$ [NC]
RewriteRule ^(.*)$ http://adlblastek.com/$1 [L,R=301]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301,NC]
RewriteEngine on
RewriteRule ^oldDirectory/([a-zA-Z0-9-_.]+)$ /newDirectory/$1 [R=301,L]
RewriteRule ^oldDirectory/([a-zA-Z0-9-_.]+)$ /newDirectory/$1 [R=301,L]
RewriteEngine on
RewriteRule ^/?Some-text-goes-here/([0–9]+)$ /picture.php?id=$1
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^pet-care/?$ pet_care_info_01_02_2008.php [NC,L] # Handle requests for “pet-care”
RewriteRule ^pet-care/?$ pet_care_info_01_02_2008.php [NC,L] # Handle requests for “pet-care”
Rewrite /path/to/old/file/old.html http://www.example.com/new/file/new.html
Redirect /path/to/old/file/old.html http://www.example.com/new/file/new.html
Final Example :
In this Example www.adlblastek.com/2015-07——/rotary-barrel-machine
Rewrite in to the www.adlblastek.com/rotary-barrel-machine
# Rewrite — http://adlblastek.com/index.php/2015-07-13-10-40-26/2015-07-13-11-07-45/2015-07-13-11-08-13/rotary-barrel-machine => http://adlblastek.com/rotary-barrel-machine
RewriteRule ^index\.php/2015-07-13-10-40-26/2015-07-13-11-07-45/2015-07-13-11-08-13/rotary-barrel-machine$ /rotary-barrel-machine?&%{QUERY_STRING}
htaccess.txt
Upload the file to the relevant directory on your web server and then rename it like so:
.htaccess
Remember, the .htaccess file should be using 644 permissions and uploaded in ASCII mode. If your .htaccess file does not work, then you should contact your system administrator or web hosting company and ensure they have enabled ‘.htaccess’ within your account, as some web hosting companies do not allow its use without prior permission. Unfortunately, .htaccess will not work on Windows-based servers.
htaccess
Ex-
Rewrite
Ex –
Redirection
Ex-
0 Comments