Same front page and posts page with slug
-
Hey guys,
Been doing some searching but still not found best solution for this:
I would like my blog home and posts page to be the same, but I would like it to have it’s own slug (home). So for example:
http://www.mydomain.com/site1/home
Reason being that I NEED to create a real subfolder off the domain called ‘site1’ with alternative content in /site1/ and subfolders. Also I have several wordpress sites setup as a network:
I have created a WordPress network setup as follows:mydomain.com/
mydomain.com/site1
mydomain.com/site2
mydomain.com/site3So by default entering URL mydomain.com/site1/anypage.html will always return ‘page not found’ in WordPress.
So, to achieve this I first got my theme’s index.php as I wanted it, then cloned it calling the new one front-page.php. In the Admin area I then created a page called ‘Home’ (no content), then went to Settings > Reading and changed ‘Front page displays’ to ‘Static’ and set BOTH Front page and Posts page to my new page called ‘Home’. Finally created an index.php in my real /site1/ folder with:
[code]
<?php
header("Location: ../site1/home");
?>
[code]Result? seems to work perfectly as far as I can see... entering http://www.mydomain.com/site1 redirects to http://www.mydomain.com/site1/home showing my front page with posts, and entering http://www.mydomain.com/site1/anypage.html takes me to that non-Wordpress page as I want.
The only thing is that in WordPress under Settings > Reading after making the change I get 'Warning: these pages should not be the same!' Is there any harm in leaving that message or better still working around it with better solution to what i want to achieve?
Thanks
- The topic ‘Same front page and posts page with slug’ is closed to new replies.