{"id":6115,"date":"2022-02-03T08:18:29","date_gmt":"2022-02-03T14:18:29","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=6115"},"modified":"2022-02-03T08:18:30","modified_gmt":"2022-02-03T14:18:30","slug":"confirming-mod_rewrite-is-enabled","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/","title":{"rendered":"Confirming mod_rewrite is enabled"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #212121;color:#212121\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #212121;color:#212121\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#what_is_mod_rewrite\" >What is mod_rewrite?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#confirming_mod_rewrite_is_enabled\" >Confirming mod_rewrite is enabled<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<div class=\"kb-shortcode kb-shortcode_info\">\n                    <div class=\"kb-shortcode-icon\">\n                        <i class=\"fa fa-info-circle fa-2x\"><\/i>\n                    <\/div>\n                    <div class=\"kb-shortcode-content_info\">KnownHost&#8217;s managed shared, reseller, vps and dedicated servers have mod_rewrite enabled by default! Lucky you! \ud83d\ude09<\/div>\n                <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-mod-rewrite\"><span class=\"ez-toc-section\" id=\"what_is_mod_rewrite\"><\/span><strong>What is mod_rewrite<\/strong>?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The mod_rewrite module uses a rule-based rewriting engine based on a PCRE regular-expression parser to rewrite requested URLs on the fly; by default, mod_rewrite maps a URL to a filesystem path. However, it can also redirect one URL to another URL or invoke an internal proxy fetch.<\/p>\n\n\n\n<p>mod_rewrite provides a flexible and powerful way to manipulate URLs using an unlimited number of rules. Each rule can have an unlimited number of attached rule conditions to allow you to rewrite URLs based on server variables, environment variables, HTTP headers, or time stamps.<\/p>\n\n\n\n<p>mod_rewrite operates on the full URL path, including the path-info section. A rewrite rule can be invoked in httpd.conf or .htaccess. The path generated by a rewrite rule can include a query string or lead to internal sub-processing, external request redirection, or internal proxy throughput.<\/p>\n\n\n\n<p><strong>In summary, mod_rewrite needs to be enabled on your server to use .htaccess configurations, such as redirects.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"confirming-mod-rewrite-is-enabled\"><span class=\"ez-toc-section\" id=\"confirming_mod_rewrite_is_enabled\"><\/span>Confirming mod_rewrite is enabled<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Due to the overwhelming majority of websites requiring mod_rewrite, it&#8217;s enabled by default. To confirm it&#8217;s enabled you can perform the following:<\/p>\n\n\n\n<p>Login to server as root and run the following command,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>httpd -l |grep rewrite<\/code><\/pre>\n\n\n\n<p>If it is enabled, you should expect the output as same as below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@duplicate &#091;~]# httpd -l|grep rewrite\nmod_rewrite.c<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><span class=\"ez-toc-section\" id=\"conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now that we\u2019ve gone over it, how to confirm mod_rewrite is enabled on the server or not. mod_rewrite is widely used to perform redirection from the web server.<\/p>\n\n\n\n<p>KnownHost offers 365 days a year, 24 hours a day, all 7 days of the week best in class technical support. A dedicated team ready to help you with requests should you need our assistance. You\u2019re not using KnownHost for the best webhosting experience? Well, why not? Check with&nbsp;<a href=\"https:\/\/www.knownhost.com\/contact\">our Sales team<\/a>&nbsp;to see what can&nbsp;<a href=\"https:\/\/www.knownhost.com\/\">KnownHost<\/a>&nbsp;do for you in improving your webhosting experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is mod_rewrite? The mod_rewrite module uses a rule-based rewriting engine based on a PCRE regular-expression parser to rewrite requested URLs on the fly; by default, mod_rewrite maps a URL to a filesystem path. However, it can also redirect one URL to another URL or invoke an internal proxy fetch. mod_rewrite provides a flexible and [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[109,123,588,501],"class_list":["post-6115","post","type-post","status-publish","format-standard","hentry","category-cpanel","tag-cpanel","tag-linux","tag-mod_rewrite","tag-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Confirming mod_rewrite is enabled - KnownHost<\/title>\n<meta name=\"description\" content=\"Isn&#039;t redirection working correctly on the server? That&#039;s because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Confirming mod_rewrite is enabled - KnownHost\" \/>\n<meta property=\"og:description\" content=\"Isn&#039;t redirection working correctly on the server? That&#039;s because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-03T14:18:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-03T14:18:30+00:00\" \/>\n<meta name=\"author\" content=\"Somesh Z\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Somesh Z\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/\"},\"author\":{\"name\":\"Somesh Z\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\"},\"headline\":\"Confirming mod_rewrite is enabled\",\"datePublished\":\"2022-02-03T14:18:29+00:00\",\"dateModified\":\"2022-02-03T14:18:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/\"},\"wordCount\":339,\"keywords\":[\"cpanel\",\"linux\",\"mod_rewrite\",\"server\"],\"articleSection\":[\"cPanel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/\",\"name\":\"Confirming mod_rewrite is enabled - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2022-02-03T14:18:29+00:00\",\"dateModified\":\"2022-02-03T14:18:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\"},\"description\":\"Isn't redirection working correctly on the server? That's because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/confirming-mod_rewrite-is-enabled\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Confirming mod_rewrite is enabled\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\",\"name\":\"Somesh Z\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"caption\":\"Somesh Z\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Confirming mod_rewrite is enabled - KnownHost","description":"Isn't redirection working correctly on the server? That's because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/","og_locale":"en_US","og_type":"article","og_title":"Confirming mod_rewrite is enabled - KnownHost","og_description":"Isn't redirection working correctly on the server? That's because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.","og_url":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/","og_site_name":"KnownHost","article_published_time":"2022-02-03T14:18:29+00:00","article_modified_time":"2022-02-03T14:18:30+00:00","author":"Somesh Z","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Somesh Z","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/"},"author":{"name":"Somesh Z","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1"},"headline":"Confirming mod_rewrite is enabled","datePublished":"2022-02-03T14:18:29+00:00","dateModified":"2022-02-03T14:18:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/"},"wordCount":339,"keywords":["cpanel","linux","mod_rewrite","server"],"articleSection":["cPanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/","url":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/","name":"Confirming mod_rewrite is enabled - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"datePublished":"2022-02-03T14:18:29+00:00","dateModified":"2022-02-03T14:18:30+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1"},"description":"Isn't redirection working correctly on the server? That's because mod_rewrite is disabled. Learn step for confirming mod_rewrite is enabled.","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/confirming-mod_rewrite-is-enabled\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"Confirming mod_rewrite is enabled"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1","name":"Somesh Z","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","caption":"Somesh Z"}}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/6115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=6115"}],"version-history":[{"count":0,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/6115\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=6115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=6115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=6115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}