0

I'm trying to use WP as a pure backend CMS for my site. I've got a few pages setup in WP e.g. About, Main Page, Sample Page and I can display the content on my own php pages by using get_page_by_title. However when I try to use wp_nav_menu to generate the navigation elements, the links generated are in the form of www.example.com/wordpress/?page=2.

I know I can change WP to use nice permalinks to get www.example.com/wordpress/about but I'd like to customise it further so that the link would read www.example.com/about e.g. skip the wordpress install location.

Is this possible and how can I do it?

1

I know I can change WP to use nice permalinks to get www.example.com/wordpress/about but I'd like to customise it further so that the link would read www.example.com/about e.g. skip the wordpress install location.

Rather than "skipping the location", point your domain to the location.
Or install WP to your root, respectively.

You could obviously do some rewriting as well, but why go the long way if the solution is simple?

As for pretty permalinks:
However you go about it, this is a necessary step on the way.

Hence set your permalink structure to something along the lines of /%year%/%postname%/.

There used to be performance downsides to using just /%postname%/, which have been fixed with 3.3, but I tend to still not use that only.
Pages will ignore /%year%/ anyway. And should you ever decide to use the blog functionality as well, I don't find a year structure hurtful. Up to you.

1
  • Thanks for that. I've just added some redirects to the .htaccess. I'd like to keep all the WP stuff in a separate directory because I'm a bit OCD. – Sonoman Jul 31 '13 at 8:13
0

It can be done with permalink settings in wp admin. (/wp-admin/options-permalink.php) Set your permalink structure to Post name or custom structure with %postname%

4
  • 2
    I'm 99% sure that won't work as the /wordpress/ bit of it isn't part of the permalink that can be modified ( at least on my install) via that options page. – Mark Davidson Jul 30 '13 at 9:49
  • 1
    your wordpress is at main domain or in wordpress folder ? – Vikram Jul 30 '13 at 9:51
  • In wordpress folder can see here i.imgur.com/nYGdNjY.png?1 only the bit after the wordpress directory is editable on custom structure. – Mark Davidson Jul 30 '13 at 9:54
  • You can then use htaccess to rewrite urls – Vikram Jul 30 '13 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.