Following .htaccess doesn't work for root level page.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^demo\-blog/(.*)$ demo\-blog/index.php/$1 [L]
If I access http://example.com/demo-blog/blog/publish.html then it works by executing file on http://example.com/demo-blog/index.php/blog/publish.html but when I access http://example.com/demo-blog/ it doesn't load the page from http://example.com/demo-blog/index.php. The .htaccess file is on the domain root. http://example.com/
Please let me know why it doesn't rewrite the url for the home page.
Change your rule to this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^demo-blog(/.*|)$ demo-blog/index.php/$1 [L,NC]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With