htaccess - for SEO


htaccess for SEO - best tips HTACCESS hypertext Access This is a file that can solve many SEO problems faced frequent site administrato...

htaccess for SEO - best tips

HTACCESS hypertext Access This is a file that can solve many SEO problems faced frequent site administrator or SEO professional. This article will describe only the basic functions of .htaccess that can significantly improve your site's performance and position in search engine results. For example one of the most frequent and not every average consumer is solvedSEO problem is dubbed the site's content, which is formed not because the site's pages, repeats the same information, but because one and the same page can be opened with a different address. This is just one example, but they can be much more, and the solution to this problem is the .htaccess file creation and insertion of a special code.

htaccess basics tips

.htaccess - SEO will solve many problems

1. How to create a .htaccess file?

2. .htaccess help determine what address will be available for your page.

3. .htaccess „clean "create url.

4. How to remove the slash „/“.

5. .htaccess code for GZIP (speed boot).

6. With .htaccess Manage your browser cache

7. The .htaccess file can do 301 redirects.

8. .htaccess to set the home page.

9.Remove the "category" in the url.

10. Use .htaccess file generator friendly.

11. Folder protection.

12. Protect .htaccess file

  1. How to create a .htaccess file?

Create .htaccess file is very simple, just need to see once and instantly learn. First, open the Notepad text editor. It is important to save exactly as shown: in quotation marks and plus do not miss the point before .htaccess.
  • File – SaveAs -- Faile name: „.htaccess“: 
How to create a .htaccess file
    This file can be edited at the same notepad'u or Notepad ++ (which is downloadable for free).

    2. htaccess help determine what address will be available for your page

    As I mentioned a common problem when a page is available with different URLs. For example:
    • /index.html

    If your site is opened on all or some of the options if there is no good, because then the appearance of duplicated content because search engines understand how different pages.
    How to make typing any of the following options would be open only to a single URL.
    To do so you need to add the following code to httacess file (of course it will have to adjust and save your own domain name instead of "manopuslapis and plus if your site is not ending" .com "and" .com "and then it's appropriate to change):
    •  RewriteEngine on
      RewriteCond %{HTTP_HOST} ^mypage\.com$ [NC]
      RewriteRule ^(.*)$ $1 [R=301,L]
      RewriteCond %{THE_REQUEST} ^.*/index.html
      RewriteRule ^(.*)index.html$ http://www.  $1 [R=301,L]
    The reverse option, if you want your page to be displayed without the "www"
    • RewriteEngine on
      RewriteCond %{HTTP_HOST} ^www.mypage\.com$ [NC]
      RewriteRule ^(.*)$ $1 [R=301,L]
      RewriteCond %{THE_REQUEST} ^.*/index.html
      RewriteRule ^(.*)index.html$ http://  $1 [R=301,L]
    SEO is better with www or non-www?
    I think the correct URL should be the web, but most importantly, to avoid duplication of content and the page would be achieved with a single URL. Also remember that all links both internal and external use a URL you set as a basic English is called canonical.


    3. .htaccess"Clean" create url

    When we talk about the concept of how to clean the url is probably not at all clear. It is meant to remove limbs .html, .php, etc.
    For example: do to show the following:
    And you can do with this code (this will remove the .html and .php to eliminate the need to adjust the code and save .php instead of .html)
    • RewriteBase /
      RewriteEngine on
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME}\.html -f
      RewriteRule ^(.*)$ $1.html
    However, there are states that left the extensions .html or .php SEO search engine robots will be easier to determine the structure of the site, because it will be easier to determine whether it is just or Fold page. So if you want to remove this ending just because you do not like it, consider whether it's worth.

    4. How to remove the slash „/“

    If you notice that your site can be accessed with the back of the dash and tilt without it. In this situation it is also necessary for concern, because the search engine robots can re-evaluate how different pages, and this will cause duplicate content issue. To remove this / hyphen in the quotation marks at the end of your URL must use the following code:
    • RewriteEngine On
      RewriteRule ^(.*)/$ http://%{HTTP_HOST}/$1 

    5. .htaccess code for GZIP (speed boot)

    You probably already know that the site / page loading speed is also influenced by the SEO results, and to speed up page loading speed can also use the .htaccess file with SPECIAL code. Gzip - server app that compresses and decompresses page of your site then automatically when needed. Thus one should take this opportunity to activate Gzip through .htaccess file in which to insert the following code
    • AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml
      text/javascript text/css application/x-javascript
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4.0[678] no-gzip
      BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    6. With .htaccess Manage your browser cache

    With the special code can set the browser cache (called cache) use. It is the same if the visitor returns to your site and then charge the service faster as will the visitor's browser cache (if she has not a visitor's browser automatic cache cleanup). So the .htaccess file, you can set the maximum cached files (such as images, HTML, CSS, JavaScrip etc.) Validity (time counted in seconds, so one day is 86 400 S)..)
    Example set of 30-day cache expiration time:
    • # 30 days
      <filesMatch “.(jpg|jpeg|png|gif|swf|ico)$”>
      Header set Cache-Control “max-age=2 592 000, public”
      # 30 days
      <filesMatch “.(xml|txt|js)$”>
      Header set Cache-Control “max-age=2 592 000, proxy-revalidate”
      # 30 days
      <filesMatch “.(html|htm|css|php)$”>
      Header set Cache-Control “max-age=2 592 000, private, proxy-revalidate”

    7. The .htaccess file can do 301 redirects:

    For example if someone changed the URL of the page, but wishing that the old URL to redirect visitors to the new need to do so (the old page: /puslapis.html, a new page: a new-old page.html ps page URLs are relative reference ie without http: / /
    • ## 301 Redirect Old File
      Redirect 301 /page.html http://www.mypage.COM/new-page.html 

    8. .htaccess to set the home page

    ..htaccess file you can set any file that will serve as the start page. For example the default file will be a key to open the index.html or index.php, but if you want to set another must use the following code (and the code can help determine who will be the first to open or index.html or index.php).
    The example set other Home:
    • DirectoryIndex NEXTPAGE.html

    9. Remove the "category" in the url

    Some CMS - content management system automatically creates an additional word of URLs that you do not want to see. And if you would like to hide NOT ACCEPTABLE category ( show as then you can use the following code:
    • RewriteRule ^category/(.+)$ http://www.MYPAGE.COM/$1 [R=301,L]

    10. Use .htaccess file generator:

    11. Folder protection

    The .htaccess file can determine the appropriate file protection so that they could enter only with a specific IP address. For example, you can set the number of IP addresses, where you usually you are located to protect the access to the site CMS (content management). For this you need to create a new .htaccess file and put in the right directory / folder.
    • order deny, allow
      deny from all
      allow from xx.xx.xx.xx
    If you need to add additional IP then copy it again the following code to add a new IP. If needed, respectively, you can specify a specific IP address, which will block users to a particular IP address.
    • ## Block users by IP
      order allow,deny
      deny from
      allow from

    12. Protect .htaccess file

    Most servers have a set of file protection, but the protection is never too much, therefore we recommend to upload the following code:
    • <Files .htaccess>
      order allow,deny
      deny from all



    domain,1,e-shop,1,facebook advertising,1,GOOGLE adwords,4,google news,13,htaccess,1,http status,1,keywords,1,links,1,meta description,1,rich snipets,1,seo articles,17,seo audit,1,seo optimization,11,seo services,7,
    web site optimization: htaccess - for SEO
    htaccess - for SEO
    web site optimization
    Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy