{"id":13,"date":"2010-10-19T10:42:52","date_gmt":"2010-10-19T08:42:52","guid":{"rendered":"http:\/\/lamiroy.com\/blog\/?p=13"},"modified":"2010-10-19T10:44:38","modified_gmt":"2010-10-19T08:44:38","slug":"apache-mod_rewrite-doesnt-seem-to-work-in-windows","status":"publish","type":"post","link":"https:\/\/www.lamiroy.com\/blog\/apache-mod_rewrite-doesnt-seem-to-work-in-windows\/","title":{"rendered":"Apache mod_rewrite doesn&#8217;t seem to work in Windows"},"content":{"rendered":"<p>I had this strange phenomenon that mod_rewrite instructions in the  .htaccess file worked online on my ISPs server, but not on my local  Windows machine that also has an Apache server running on it.<\/p>\n<p>I kept getting 404 errors: page not found.<\/p>\n<p>Which is a bit annoying: I&#8217;ve got drupal, joomla and other software  running on my local server, but none of them could use &#8216;clean URLs,&#8217;  which is what I want to use.<\/p>\n<p>It turns out that the default configuration of Apache on windows is to NOT allow .htaccess to be used.<\/p>\n<p>So the problem wasn&#8217;t that the mod_rewrite didn&#8217;t work. The real problem was that the .htaccess file was just ignored.<\/p>\n<p>The best solution for that is to modify your httpd.conf file. (Stop  the Apache service before you modify it. Start it again when completed).<\/p>\n<p>If you&#8217;ve installed, e.g, drupal in a directory &#8220;c:\\websites\\drupal&#8221; and  you want to use mod_rewrite for clean URLs, then you&#8217;d have to add the  following lines to the httpd.conf file:<\/p>\n<p>&lt;Directory &#8220;C:\/websites\/drupal\/&#8221;&gt;<br \/>\nAllowOverride All<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\n&lt;\/Directory&gt;<\/p>\n<p>You have to do this for each directory \/ folder you want to use .htaccess in.<\/p>\n<p>The &#8211; far less secure- alternative is to change the default settings of your Apache and by default allow .htaccess to be used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had this strange phenomenon that mod_rewrite instructions in the .htaccess file worked online on my ISPs server, but not on my local Windows machine that also has an Apache server running on it. I kept getting 404 errors: page not found. Which is a bit annoying: I&#8217;ve got drupal, joomla and other software running &hellip; <a href=\"https:\/\/www.lamiroy.com\/blog\/apache-mod_rewrite-doesnt-seem-to-work-in-windows\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Apache mod_rewrite doesn&#8217;t seem to work in Windows<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[6,7,8],"class_list":["post-13","post","type-post","status-publish","format-standard","hentry","category-troubleshooting","tag-apache","tag-htaccess","tag-mod_rewrite"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/posts\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":3,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions"}],"predecessor-version":[{"id":15,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/posts\/13\/revisions\/15"}],"wp:attachment":[{"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/media?parent=13"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/categories?post=13"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lamiroy.com\/blog\/wp-json\/wp\/v2\/tags?post=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}