{"id":77,"date":"2010-06-01T00:00:57","date_gmt":"2010-06-01T05:00:57","guid":{"rendered":"http:\/\/sushain.com\/blog\/?p=77"},"modified":"2020-06-21T23:17:39","modified_gmt":"2020-06-22T04:17:39","slug":"resolving-403-forbidden-page-error-for-wordpress-blogs","status":"publish","type":"post","link":"https:\/\/sushain.com\/blog\/resolving-403-forbidden-page-error-for-wordpress-blogs\/","title":{"rendered":"Resolving 403 forbidden page error for WordPress blogs"},"content":{"rendered":"<p>Few years back, I decided to move and completely re-purpose my blog from Blogger\/Blogspot to WordPress. The transition was mainly driven by a desire to host the blog on my own domain since that gives me a lot more flexibility to customize and manage the content. Luckily, my hosting provider had a ready installation package for setting up a wordpress blog and so that part went relatively smoothly. However, once I tried to launch the landing page of the blog, I got <em>page forbidden (403)<\/em> error. Incidentally, it was occurring on every relative URL\/page for the blog (including \/wp-admin). After quite a bit of hassle, I was eventually able to resolve the issue and things seemed to work alright from that point onward. I thought of documenting an abbreviated version of the procedure in case anyone else might run into a similar problem while transitioning their blog to WordPress.<\/p>\n<p>Firstly, I checked the permissions on the installation folder (in my case, <em>&lt;root&gt;\/blog<\/em>) and found it to be OK (<em>755 for read \/ execute to world<\/em>).<\/p>\n<p>Next, I checked <em>.htaccess<\/em> located under \/root folder. I had a prior Ruby on Rails install that had the following configuration &#8211;<\/p>\n<p><em>RewriteEngine on<\/em><\/p>\n<p><em>RewriteCond %{HTTP_HOST} ^sushain.com$ [OR]<br \/>\nRewriteCond %{HTTP_HOST} ^www.sushain.com$<br \/>\nRewriteRule ^contest http:\/\/127.0.0.1:12009%{REQUEST_URI} [P,QSA,L]<br \/>\nDirectoryIndex preload.html index.html<br \/>\n# BEGIN WordPress<\/em><\/p>\n<p><em># END WordPress<\/em><\/p>\n<p>I had a hunch that the URL rewriting module might&#8217;ve been misbehaving, but didn&#8217;t want to tinker with it since I may have needed the RoR app (dormant at the time) to come alive sometime in the future. What I did instead was to change the .htaccess file in the \/blog folder from &#8211;<\/p>\n<p><em>DirectoryIndex index.php<br \/>\nAuthUserFile &#8220;\/home\/sushainp\/.htpasswds\/public_html\/blog\/passwd&#8221;<\/em><\/p>\n<p>to &#8211;<\/p>\n<p><em>DirectoryIndex index.php<br \/>\nAuthUserFile &#8220;\/home\/sushainp\/.htpasswds\/public_html\/blog\/passwd&#8221;<br \/>\n# BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/blog\/<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/blog\/index.php [L]<br \/>\n&lt;\/IfModule&gt;<\/em><\/p>\n<p><em># END WordPress<\/em><\/p>\n<p>This effectively ended up overriding the URL rewriting defaults for everything matching \/blog\/* URL pattern and thus, resolved the issue. For those of you interested in learning more about URL rewriting module, more information is available<span style=\"text-decoration: underline;\"> <a href=\"http:\/\/httpd.apache.org\/docs\/1.3\/mod\/mod_rewrite.html\">here<\/a><\/span>.<\/p>\n<p>Cheers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few years back, I decided to move and completely re-purpose my blog from Blogger\/Blogspot to WordPress. The transition was mainly driven by a desire to host the blog on my own domain since that gives me a lot more flexibility to customize and manage the content. Luckily, my hosting provider had a ready installation package <a class=\"read-more\" href=\"https:\/\/sushain.com\/blog\/resolving-403-forbidden-page-error-for-wordpress-blogs\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":456,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[1],"tags":[186,222,187,223,229,184],"_links":{"self":[{"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/posts\/77"}],"collection":[{"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":13,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":1145,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions\/1145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/media\/456"}],"wp:attachment":[{"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sushain.com\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}