WordPress.org

Support

Support » How-To and Troubleshooting » Custom page urls?

Custom page urls?

  • Not sure if there is an easy way to do this.
    I’m trying to make it so “site.com/?page_id=7” can be linked as “site.com/7”. I know that with slugs you can make it look like “site.com/?page_id=testtitle” or whatever, but I was wondering if there was an easy way to make it show up without the “?page_id=” part.

    My guess is the only way to do this is create a directory for each page, and put in a header redirect in the htaccess of the directory to link to “site.com/?page_id=7”.

    Any ideas?
    Thanks.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Enable permalinks on your site and you will be able to access your pages as; site.com/<page-slug>. That makes it eaiser to find for your visitors than site.com/7 or site.com/9..

    Regards

    You could write your own mod_rewrite rule..

    Or have WP do it for you. 🙂

    Worked.
    Thank you.

    You just saved me a boatload of time 😉

    Quick question though…
    when WP is referring to the .htaccess file, is it the htaccess file for the domain, or the htaccess for the server root?

    Well that depends on your server structure I guess. Some hosts allow you to have multiple fully-hosted domain within a single account, in that case WP will be playing with the .htaccess that pertains to the domain on which it is installed.

    Regards

    It seems something got messed up here too…
    In my links bar (that links to the catagories) it automatically prefixes the links with /catagory/ so the links that should show up as “site.com/cat-name” show up as “site.com/catagory/cat-name” and I can’t find anywhere to change this…
    Weird. Anyone know what is causing this?
    Thanks a lot.

    Ah thanks Cypher.

    What is your permalinks structure? That’s where /category/ is usually coming from.

    Regards

    Uh oh…
    I can’t create new pages anymore either. Well, I can create them but when I go to them it says “Sorry, no posts matched your criteria.”

    The permalinks structure is “/%postname%”. That’s it.

    For creating new Pages and being able to use the permalinks with them your .htaccess file has to be writeable ALL the time, so WP can write the new rules into it every time you create a new Page.

    Moshu, it is writtable: 666.

    I also see that it IS writting to the htaccess….
    Odd.

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Custom page urls?’ is closed to new replies.
Skip to toolbar