{"id":2147,"date":"2015-04-14T13:47:27","date_gmt":"2015-04-14T13:47:27","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=2147"},"modified":"2015-04-14T13:47:27","modified_gmt":"2015-04-14T13:47:27","slug":"how-to-check-whether-mod_rewrite-is-enable-on-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/04\/14\/how-to-check-whether-mod_rewrite-is-enable-on-server\/","title":{"rendered":"How to check whether mod_rewrite is enable on server?"},"content":{"rendered":"<p>Usually cpanel(WHM) compiles mod_rewrite by default. You can check with this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nroot@server &#x5B;~]# httpd -l|grep rewrite\n\n<\/pre>\n<p>So you must just activate it in your &#8216;.htaccess&#8217; using:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nRewriteEngine On\n\n<\/pre>\n<p>To check if mod_rewrite module is enabaled, create a new php file in your root folder of your WAMP server. Enter the following<\/p>\n<p>phpinfo();<\/p>\n<p>Access your created file from your browser.<\/p>\n<p>Ctrl+F to open a search. Search for &#8216;mod_rewrite&#8217;. If it is enabled you see it as &#8216;Loaded Modules&#8217;<\/p>\n<p>If not, open httpd.conf (Apache Config file) and look for the following line.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#LoadModule rewrite_module modules\/mod_rewrite.so\n\n<\/pre>\n<p>remove the pound (&#8216;#&#8217;) sign at the start and save the this file.<\/p>\n<p>Restart your apache server.<\/p>\n<p>Access the same php file in your browser.<\/p>\n<p>search for &#8216;mod_rewrite&#8217; again. You should be able to find it now.<\/p>\n<p>For Plesk Servers<\/p>\n<p>Log into your server via ssh as root.<\/p>\n<p>Mod Rewrite is enabled by default on plesk servers. You can verify this with the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n \n# apachectl -M | grep rewrite\n\n<\/pre>\n<p>modify the vhost.conf file at \/var\/www\/vhosts\/example.com\/conf\/vhost.conf<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n \n# replace &quot;AllowOverride None&quot; with &quot;AllowOverride all&quot;.\n\n<\/pre>\n<p>restart apache with the following command: <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nservice httpd restart\n \n<\/pre>\n<p>Create a .htaccess containing the following and upload it to the root of your site:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n \nRewriteEngine On\nRewriteRule ^google.html$ http:\/\/www.google.com\/ &#x5B;R=301]\n\n<\/pre>\n<p>Going to http:\/\/www.yoursite.com\/google.html should redirect you to Google.com if you have mod rewrite enabled and your syntax is correct.<\/p>\n<p>For more information on Mod rewrite see the following links.<\/p>\n<p>http:\/\/httpd.apache.org\/docs\/current\/mod\/mod_rewrite.html<br \/>\nhttp:\/\/httpd.apache.org\/docs\/2.0\/misc\/rewriteguide.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Usually cpanel(WHM) compiles mod_rewrite by default. You can check with this: root@server &#x5B;~]# httpd -l|grep rewrite So you must just activate it in your &#8216;.htaccess&#8217; using: RewriteEngine On To check if mod_rewrite module is enabaled, create a new php file in your root folder of your WAMP server. Enter the following phpinfo(); Access your created &#8230; <a title=\"How to check whether mod_rewrite is enable on server?\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/04\/14\/how-to-check-whether-mod_rewrite-is-enable-on-server\/\" aria-label=\"Read more about How to check whether mod_rewrite is enable on server?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2147"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}