Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 ?

share|improve this question
add comment

3 Answers

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!

share|improve this answer
    
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 Feb 19 '11 at 18:23
add comment

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.

share|improve this answer
    
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 Feb 19 '11 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 Feb 19 '11 at 22:32
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.