I'm creating blog page as WordPress for my static PHP website. When blog page URL changes to pretty permalink (example.com/blog/my-post-page), loading contents (not redirecting to index.php, only contents loading and URL will be like http://example.com/blog/my-post-page) of index.php (home page for my site) that is located outside blog folder instead of single.php contents.

When permalink changes to default (example.com/blog/?p=123), it will work perfectly.

I need URL as http://example.com/blog/my-post-page.

EDIT : - I have updated permalink to Custom Structure as /index.php/%postname%/. But now post pages are showing with example.com/blog/index.php/my-post-page.

I think the issue raised with the new WordPress version. (Version 4.2.2). Any solutions to remove index.php from URL ?

My Directory Structure:-

/                                          - Root
/blog                                      - Blog folder
/blog/wp-content/themes/mytheme/           - Theme folder
/blog/wp-content/themes/mytheme/single.php - Post Single page

/index.php                                 - Home page (Loading contents of this file)

My htaccess :-

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

When I delete/rename index.php in root folder, page will show not found error.

  • Is the .htaccess in / or /blog (it should be in the latter) – TheDeadMedic Jun 1 '15 at 10:25
  • What does "only contents loading" mean? – s_ha_dum Jun 1 '15 at 14:11
  • @s_ha_dum contents loading means, URL will be the post page what we are requesting for blog. But the contents are from the outside index.php file. – Sree Jun 2 '15 at 3:38
  • @TheDeadMedic .htaccess inside /blog folder. – Sree Jun 2 '15 at 3:38

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.