{"id":6440,"date":"2021-07-10T18:05:18","date_gmt":"2021-07-10T12:35:18","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6440"},"modified":"2021-07-10T18:05:25","modified_gmt":"2021-07-10T12:35:25","slug":"how-to-enable-mod_rewrite-for-apache-in-centos","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-enable-mod_rewrite-for-apache-in-centos\/","title":{"rendered":"How to enable mod_rewrite for Apache in CentOS"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">How to enable mod_rewrite for Apache in CentOS<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">Date: 10-07-2021<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">CentOS 7 and later versions have mod_rewrite installed and enabled by default. Open terminal and run the below command to check if mod_rewrite is already enabled in your system.<br><strong><code># httpd -M | grep rewrite<\/code><\/strong><br>If you see the output like below, mod_rewrite is already enabled in your CentOS linux.<br><strong><code>rewrite_module (shared)<\/code><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-10-at-5.19.22-PM.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"626\" height=\"104\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-10-at-5.19.22-PM.png\" alt=\"\" class=\"wp-image-6442\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-10-at-5.19.22-PM.png 626w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2021\/07\/Screen-Shot-2021-07-10-at-5.19.22-PM-300x50.png 300w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If not enabled, open Apache module configuration file  by using following command.<br><strong><code>#vi \/etc\/httpd\/conf.modules.d\/00-base.conf<\/code><\/strong><br>check the below line <br><code><strong>#LoadModule rewrite_module modules\/mod_rewrite.so<\/strong><\/code><br>and remove the<strong><code> # <\/code><\/strong>sign at its beginning, to enable mod_rewrite.<br><strong><code>LoadModule rewrite_module modules\/mod_rewrite.so<\/code><\/strong><br>If you don\u2019t find the above line, just add it to the configuration file and restart the apache service.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you!<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to enable mod_rewrite for Apache in CentOS Date: 10-07-2021 CentOS 7 and later versions have mod_rewrite installed and enabled [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[278,890,891],"class_list":["post-6440","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-apache","tag-apache-rewrite-module","tag-enable-mod_rewrite","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1FS","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6440"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6440\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}