{"id":12883,"date":"2019-08-01T09:30:19","date_gmt":"2019-08-01T09:30:19","guid":{"rendered":"https:\/\/mobitek.com\/what-is-htaccess-file-and-how-to-use-it\/"},"modified":"2024-08-19T14:15:40","modified_gmt":"2024-08-19T14:15:40","slug":"what-is-htaccess-file-and-how-to-use-it","status":"publish","type":"post","link":"https:\/\/mobitek.com\/en\/what-is-htaccess-file-and-how-to-use-it\/","title":{"rendered":"What is .htaccess File? and How to Use it?"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"12883\" class=\"elementor elementor-12883 elementor-7585\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-cc66961 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"cc66961\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-21e9ce2\" data-id=\"21e9ce2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9152421 elementor-widget elementor-widget-text-editor\" data-id=\"9152421\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tThe <strong>.htaccess file<\/strong> (Hypertext Access) is used by network servers like Apache to allow configuration changes for web domains. It enables you to make various modifications, permissions, and restrictions on your site. So, what exactly does .htaccess do? Let&#8217;s explore together in our blog post what the .htaccess file is and what it does! \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6469d66 elementor-widget elementor-widget-heading\" data-id=\"6469d66\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What is .htaccess File? <\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-309192d elementor-widget elementor-widget-text-editor\" data-id=\"309192d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>With the help of <ins> a .htaccess file<\/ins>, you can, for example, add password protection to a folder and provide authorization. One of the best things about this file application is that you can create a .htaccess file for your own website without the need for any code knowledge.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bc00cc2 elementor-widget elementor-widget-heading\" data-id=\"bc00cc2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What can be done with .htaccess File! <\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d0bca0c elementor-widget elementor-widget-text-editor\" data-id=\"d0bca0c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul>\n<li>You can create SEO compatible link structure.<\/li>\n<li>You can do hotlink blocking<\/li>\n<li>You can hide files<\/li>\n<li>You can edit error pages<\/li>\n<li>You can set folder authorization limitation.<\/li>\n<li>You can block enemy bots<\/li>\n<li>You can configure WWW<\/li>\n<li>You can perform security operations such as file encryption and password protection<\/li>\n<li>You can block ip<\/li>\n<li>You can do domain redirection<\/li>\n<li>You can optimize your data by compressing it<\/li>\n<li>You can create your care page<\/li>\n<li>You can block spam.<\/li>\n<li>You can detect and redirect iPhone&nbsp; and do many more operations.<\/li>\n<\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e058292 elementor-widget elementor-widget-heading\" data-id=\"e058292\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">How to Use the .htaccess File and Where to Find It? <\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-67de36b elementor-widget elementor-widget-text-editor\" data-id=\"67de36b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tYou can access the .htaccess file via cPanel or FTP and make changes as you wish. The process of creating a new file for this is; \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-32125e9 elementor-widget elementor-widget-text-editor\" data-id=\"32125e9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p># BEGIN HTTPS Redirection<br \/>&lt;IfModule mod_rewrite.c&gt;<br \/>RewriteEngine On<br \/>RewriteCond %{HTTPS} off<br \/>RewriteCond %{REQUEST_URI} !^\/[0-9]+\\..+\\.cpaneldcv$<br \/>RewriteCond %{REQUEST_URI} !^\/[A-F0-9]{32}\\.txt(?:\\ Comodo\\ DCV)?$<br \/>RewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]<br \/>&lt;\/IfModule&gt;<br \/># END HTTPS Redirection<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-840ddf1 elementor-widget elementor-widget-text-editor\" data-id=\"840ddf1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tThis file is located in the main document directory of the website. To view the file; \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3ef8ca7 elementor-widget elementor-widget-text-editor\" data-id=\"3ef8ca7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul>\n<li>Log in to your cPanel administration panel,<\/li>\n<li>Click on the file manager icon,<\/li>\n<li>Check the \u201cShow hidden files\u201d option,<\/li>\n<li>Select the document directory&nbsp; click the \u201cgo\u201d button,<\/li>\n<li>You can view and edit <strong> the .htaccess file<\/strong> under the public_html folder.<\/li>\n<\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8b24391 elementor-widget elementor-widget-heading\" data-id=\"8b24391\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Impact of .htaccess File on SEO <\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3ef56dc elementor-widget elementor-widget-heading\" data-id=\"3ef56dc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">1. 301 Redirects <\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fb9003a elementor-widget elementor-widget-text-editor\" data-id=\"fb9003a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t301 redirects are actually permanent URL redirects. It does the job of redirecting web users and search engine bots to the pages you change. This way, search engines don\u2019t have to crawl old and new web pages simultaneously, and you avoid potential content issues. \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-421e17f elementor-widget elementor-widget-heading\" data-id=\"421e17f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">2. Dynamic URL \u2013 Static URL Redirects <\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f1277cc elementor-widget elementor-widget-text-editor\" data-id=\"f1277cc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>For your URLs to be SEO-friendly, it is important that they are easy to read and understand when viewed, and that they are relevant to the content. If the URL structure is easy to read when you see it and you can understand that it is relevant to the content, it means that this URL has a structure that is compatible with SEO.<\/p>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8284cef elementor-widget elementor-widget-heading\" data-id=\"8284cef\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">3. URL Problems <\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8f4e1fd elementor-widget elementor-widget-text-editor\" data-id=\"8f4e1fd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tYour website&#8217;s home page should only open one URL, otherwise you may run into duplicate content issues. This may cause you negative SEO results. \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c1d799e elementor-widget elementor-widget-heading\" data-id=\"c1d799e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">4. 404 Pages <\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c9f9e88 elementor-widget elementor-widget-text-editor\" data-id=\"c9f9e88\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tWhen users attempt to access pages you have removed from your website, they will encounter 404 error pages. It is crucial to properly create these error pages and correctly configure them in your .htaccess file. Failure to do so may result in incorrect redirects and negatively impact your SEO. \t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The .htaccess file (Hypertext Access) is used by network servers like Apache to allow configuration changes for web domains. It enables you to make various modifications, permissions, and restrictions on your site. So, what exactly does .htaccess do? Let&#8217;s explore together in our blog post what the .htaccess file is and what it does! What&hellip; <a class=\"more-link\" href=\"https:\/\/mobitek.com\/en\/what-is-htaccess-file-and-how-to-use-it\/\">Continue reading <span class=\"screen-reader-text\">What is .htaccess File? and How to Use it?<\/span><\/a><\/p>\n","protected":false},"author":14,"featured_media":12584,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"class_list":["post-12883","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo","entry"],"_links":{"self":[{"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/posts\/12883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/comments?post=12883"}],"version-history":[{"count":2,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/posts\/12883\/revisions"}],"predecessor-version":[{"id":15648,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/posts\/12883\/revisions\/15648"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/media\/12584"}],"wp:attachment":[{"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/media?parent=12883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/categories?post=12883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobitek.com\/en\/wp-json\/wp\/v2\/tags?post=12883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}