__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
Edit the contents of the file. Check the following examples:
Point an entire site to a different URL, such as domain.net redirected to domain.com:
# This allows you to redirect your entire website to any other domain Redirect 301 / http://kb.mediatemple.net/
Redirect index.html to a specific subfolder:
# This allows you to redirect index.html to a specific subfolderRedirect /index.html http://mt-example.com/newdirectory/
Redirect to a specific index page:
# Provide Specific Index Page (Set the default handler)DirectoryIndex index.html
Redirect users to access the site without www:
# To redirect all users to access the site WITHOUT the www. prefix,# (http://www.example.com/... will be redirected to http://example.com/...)# adapt and uncomment the following:RewriteEngine OnRewriteCond %{HTTP_HOST} ^www\.mt-example\.com$ [NC]RewriteRule ^(.*)$ http://mt-example.com/$1 [L,R=301]
Redirect users to use www:
# To redirect all users to access the site WITH the www. prefix,# (http://example.com/... will be redirected to http://www.example.com/...)# adapt and uncomment the following:RewriteEngine OnRewriteCond %{HTTP_HOST} !^www\.mt-example\.com$ [NC]RewriteRule ^(.*)$ http://www.mt-example.com/$1 [L,R=301]
Redirect viewers of your domain to use the secure version of your domain:
# An easy to way to always redirect the user to secure connection (https://) can be accomplished with the following lines:RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.mt-example.com/$1 [R,L]
Redirect users to use https:// for a particular folder:
# In case you wish to force HTTPS for a particular folder you can use the following:RewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteCond %{REQUEST_URI} somefolderRewriteRule ^(.*)$ https://www.mt-example.com/somefolder/$1 [R,L]
Now upload the file to your root folder of your site and be sure to rename it to .htaccess without any filename extension.
hello mate, you don't need to go through much hassle. just go to global configuration then SEO Settings then click the radio button that says "YES" to "Search Engine Friendly URLs" and you are good to go.