WordPress.org

Ready to get started?Download WordPress

Forums

Custom page urls? (21 posts)

  1. bang
    Member
    Posted 9 years ago #

    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.

  2. Cypher
    Member
    Posted 9 years ago #

    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

  3. eridan
    Member
    Posted 9 years ago #

    You could write your own mod_rewrite rule..

  4. Cypher
    Member
    Posted 9 years ago #

    Or have WP do it for you. :)

  5. bang
    Member
    Posted 9 years ago #

    Worked.
    Thank you.

  6. bang
    Member
    Posted 9 years ago #

    You just saved me a boatload of time ;)

  7. bang
    Member
    Posted 9 years ago #

    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?

  8. Cypher
    Member
    Posted 9 years ago #

    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

  9. bang
    Member
    Posted 9 years ago #

    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.

  10. bang
    Member
    Posted 9 years ago #

    Ah thanks Cypher.

  11. Cypher
    Member
    Posted 9 years ago #

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

    Regards

  12. bang
    Member
    Posted 9 years ago #

    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."

  13. bang
    Member
    Posted 9 years ago #

    The permalinks structure is "/%postname%". That's it.

  14. moshu
    Member
    Posted 9 years ago #

    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.

  15. bang
    Member
    Posted 9 years ago #

    Moshu, it is writtable: 666.

  16. bang
    Member
    Posted 9 years ago #

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

  17. bang
    Member
    Posted 9 years ago #

    Ok, I can create pages again.....though I still am getting that extra "/catagory/" before links.

  18. bang
    Member
    Posted 9 years ago #

    Bump....
    Any advice on this?
    Thanks.

  19. moshu
    Member
    Posted 9 years ago #

    Why don't you read what is there on the Permalink settings page?
    If you like, you may enter a custom prefix for your category URIs here. For example, /taxonomy/categorias would make your category links like http://example.org/taxonomy/categorias/uncategorized/. If you leave this blank the default will be used.

    The default for categories is - "category" :)

  20. bang
    Member
    Posted 9 years ago #

    Yes, I did read that but what if I don't want any sub-directory? I assumed I would leave it blank...

  21. bang
    Member
    Posted 9 years ago #

    Anyone know what's up?
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.