{"id":85,"date":"2006-02-10T20:41:00","date_gmt":"2006-02-10T20:41:00","guid":{"rendered":"http:\/\/blog.trungson.com\/?p=85"},"modified":"2006-02-10T20:41:00","modified_gmt":"2006-02-10T20:41:00","slug":"problem-w-htaccess-and-mod_rewrite","status":"publish","type":"post","link":"http:\/\/blog.trungson.com\/?p=85","title":{"rendered":"Problem w\/ .htaccess and mod_rewrite"},"content":{"rendered":"<p>Purpose: maintain the same .htaccess file between localhost and production servers. Making changes to one file is better than editing two or more.<\/p>\n<p>Problem: directory for the project at local &#038; production server are different. Therefore, RewriteBase of mod_rewrite needs to be set differently. Eg:<\/p>\n<ul>\n<li>Local: http:\/\/localhost\/working\/abc.html<\/li>\n<li>Production: http:\/\/example.com\/abc.html<\/li>\n<\/ul>\n<p>Solution\/Hack: have this in httpd.conf for the localhost<br \/>\n<textarea name=\"code\" class=\"xml\"><br \/>\n<directory \"c:\/htdocs\/working\"><br \/>\n# Maintaining the same .htaccess &#038; still able to change RewriteBase<br \/>\nAllowOverride None<br \/>\nInclude &#8220;c:\/htdocs\/working\/.htaccess&#8221;<br \/>\n# Override the base value, the value in .htaccess is for production server<br \/>\nRewriteBase \/working<br \/>\n<\/directory><br \/>\n<\/textarea><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Purpose: maintain the same .htaccess file between localhost and production servers. Making changes to one file is better than editing two or more. Problem: directory for the project at local &#038; production server are different. Therefore, RewriteBase of mod_rewrite needs to be set differently. Eg: Local: http:\/\/localhost\/working\/abc.html Production: http:\/\/example.com\/abc.html Solution\/Hack: have this in httpd.conf for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/85"}],"collection":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":0,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.trungson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}