0

I would like to make it so the URLs of my pages (created in the Wordpress dashboard) show up right after the domain name instead of after the blog directory.

I have installed Wordpress in a directory called blog which is located in the public_html directory. When I make a page from the Wordpress dashboard it will by default appear under the blog directory like:

www.site.com/blog/page

What I would like to do is take advantage of Wordpress's built in 'pretty URL' styling but use them outside of the blog directory where Wordpress is installed. So for example:

www.site.com/page

When I try to manually create a page, add it in public_html directory and view it on my site it looks like:

www.site.com/page.html 

I don't like the trailing .html because it is not clean looking and just extra unneeded info for the visitor.

UPDATE:

Also keep in mind that I would also like to keep the URLs of each post looking like:

www.site.com/blog/post

So to sum it up:

How can I make my Wordpress page URLs look like www.site.com/page while having my Wordpress installed in www.site.com/blog as well as having my post URLs looking like www.site.com/blog/post ?

3 Answers 3

2

You just set the WordPress directory in your WP General Settings to your top-level URL (www.site.com/), then copy index.php to the root directory of your site and modify it to load content from your actual wp directory.

Step by step instructions are here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

I did this for my personal web site: http://dannythorpe.com. The WP files are actually located in a subdir of the web root (public_html), not the web root dir.

No URL rewriting is required!

1
  • dthrope, unfortunately this did not solve my problem and this is due to my unclear explanation of my problem. I have updated the question. Anyways, after following the instructions you sent me, I tested my site out and realized that my posts and pages showed up like www.site.com/post and www.site.com/page respectively. The first problem is that I'd like the posts to be showing up like www.site.com/blog/post. The second problem is that the content of the WP created pages is not being displayed. The URL of each page is fine though.
    – user3297
    Commented Feb 19, 2011 at 18:23
1

The easiest way is just to install WordPress in the root directory instead of in the subdirectory /blog/.

Then if you want posts still to appear in /blog/ you can edit the permalinks structure in your Settings to include that.

2
  • Gesher, I am trying to make this as streamlined for my client so I can't do work arounds like this. There has to be a solution to this.
    – user3297
    Commented Feb 19, 2011 at 18:24
  • @classer: There is not. If you have the WP site installed in /blog, then /blog is required on all WP URLs. This isn't a WordPress limitation, it has to do with how webservers work.
    – Otto
    Commented Feb 19, 2011 at 22:32
0

Success!

All I had to do was install WP in my root and then go to Settings > Reading > Front page displays > and then select 'blog' as my 'posts page'.

For my front page I used a custom template that I created from this tutorial http://www.wordpressmax.com/customize-wordpress/custom-page which is semi dated but the info is still accurate.

1
  • Isn't this what I said?
    – gesher
    Commented Jun 6, 2014 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.