Forums

%post_id% only permalink comes with "/date" and death links (18 posts)

  1. TinaR
    Member
    Posted 8 months ago #

    Hi!

    I put the /%post_id%/ only in, because I'd like to use it as permalink

    1. That means that the URL is like http://www.domain.tld/123 (numbers)

    2. The Links to the archive get the structure http://www.domain.tld/date/year/month

    3. the following archivelinks get the URL http://www.domain.tld/date/year/month/page/pagenumber, but mysteriously these pages don't exist, although the should appear. If you click "next" you get a error 404.

    But when I try the permalink /%postname%/ ...

    4. ... the URL will be http://www.domain.tld/title-of-post and if the article got a title you although can reach the page under the post id

    5. ... the archivelinks have the structure http://www.domain.tld/year/month/ (yeah, without that stupid word "date")

    6. the following archivelinks have the right URL http://www.domain.tld/year/Month/page/pagenumber and the DO work!

    I'd like to use the combination of 1., 5., and 6..

    But I just don't get it. I have to get rid of the "/date" in the archivelinks and fix the following archivelinks. (Catergorylinks work fine.) I used Google, tried some plugins, nothing helped.

  2. hotkee
    Member
    Posted 8 months ago #

    For starters, you cant use /%post_id%/ on its own as a permalink.
    Use something like /%category%/%post_id%/

    I cant test this myself but do the above and see where you get with the rest of your issues.

    You might have seen this already but if not http://codex.wordpress.org/Using_Permalinks

  3. TinaR
    Member
    Posted 8 months ago #

    Nahh, the slash behind /%post_id% doesn't make any difference and I already removed /category using the Plugin Decategorizer. And I certainly read the codex-page a hundred times, it's not there and until now nobody on the Web does have any clue :-(.

    I'd like to use the Post ID only, I don't want Wordpress to add the word /date to the archive structure and I want that thing to work without any errors. How come that's such a big issue?

  4. hotkee
    Member
    Posted 8 months ago #

    you need to look into rewriting urls (probably with the .htaccess file) unless someone else comes up with a better solution (a plugin).

    Either way its messy - I would suggest not worry about that data stuff and just use /%categoy%/%post_id%/

  5. TinaR
    Member
    Posted 8 months ago #

    Oh great idea, then I get e.g. example.com/%categoy%/908/ and if you klick it 400 Bad Request - it's all messed up.

    How come it's so [moronic expletive deleted] difficult to use just the %post_id%?!

    Where are the Wordpress programmers and insiders? Are they afraid of admitting beginner's mistakes?

    Please, could anybody tell me that this simple problem can't be solved, though that I may give up this hope and stop wasting time?!

  6. hotkee
    Member
    Posted 8 months ago #

    /%category%/%post_id%/

    was what i intended to say

    I hope others can help you with your simple problem.

  7. Otto42
    Moderator
    Posted 8 months ago #

    Please, could anybody tell me that this simple problem can't be solved, though that I may give up this hope and stop wasting time?!

    This problem (which is not "simple") cannot be solved. Why? Because you're trying to do two incompatible things.

    If you had it your way (post_id only permalinks, no "date") , then please tell me what a URL of http://www.domain.tld/2009 points to... The yearly archive for 2009, or the post with ID of 2009? How can WordPress tell the difference?

    When you have a numeric identifier at the front of your permalink string, WordPress adds the /date/ identifier to prevent it from being confused between the numeric identifier and the possible year. This is similar to the reason that you cannot have numeric slugs for pages and posts. WordPress cares about numeric-only things and uses those as part of its ruleset to determine what the underlying request is for.

    Rewrite rules are never "simple", and if WordPress wants to do it a specific way, then there is a reason for it doing it that way. It doesn't change rules arbitrarily.

  8. TinaR
    Member
    Posted 8 months ago #

    @Otto42

    Ah, I get it. Well, o.k., we'll keep the ugly date ;-).

    May we change it in something else, e.g. d? Probably not.

    But when I just use the %post_id% I still got the problem that the archive (back/forward) links don't work right:

    3. the following archivelinks get the URL http://www.domain.tld/date/year/month/page/pagenumber, but mysteriously these pages don't exist, although they should appear. If you click "next" you get a error 404.

    Example:

    -> you navigate to the archive of march 2009

    which is http://www.example.org/date/2009/03/

    so far no problems

    -> now you scroll down and click Next

    supposed to be http://www.example.org/date/2009/03/page/2

    *boom* error 404! Why???

    No problem if you just use %post_name%.

    I already tried what is described in the last paragraph but it didn't work for me because it didn't change a thing. (The recreated .htaccess has the same content as the one I deleted in that process.)

    Paged Navigation Doesn't Work Sometimes navigation to second (and subsequent) pages of posts does not work as expected. Your page may generate a link to a page with one of these URIs: http://www.example.com/page/2/
    http://www.example.name/category/categoryname/page/2/
    http://www.example/year/month/day/page/2/
    http://www.example/year/month/page/2/
    The result of clicking one of those links is that the page loads with all the surroundings (header, footer, sidebar), but instead of a page of posts, there is an error message: "Sorry, no posts match that criteria." This is due to a glitch in the .htaccess file that WordPress generates. To fix it, delete the contents of your .htaccess file and re-create it.

    1. In the Control Panel, go to Manage > Files (More Info on Editing Files)
    2. Click the link to your .htaccess file to edit its contents
    3. Copy the contents of the file and paste it to a text file in a text editor. This is a precaution in case your .htaccess file has manual entries for redirects, denials or other handy htaccess tricks
    4. Delete all contents from your .htaccess file and click the Update File button.
    5. In the Control Panel, go to Options > Permalinks.
    6. Click the Update Permalink Structure button to freshly generate new rewrite rules for your permalinks.
    7. Test the results using a link that had previously broken.
    8. Add any manual htaccess entries back in your file (Place manual htaccess entries before the # BEGIN WordPress or after # END WordPress lines.)

    You may also perform similar steps by deleting the .htaccess files from the server, creating a fresh empty .htaccess file, changing its permissions to 666, and then in Options > Permalinks generate a new set of htaccess rules by clicking the Update Permalinks Structure button.

  9. TinaR
    Member
    Posted 8 months ago #

    If you had it your way (post_id only permalinks, no "date") , then please tell me what a URL of http://www.domain.tld/2009 points to... The yearly archive for 2009, or the post with ID of 2009? How can WordPress tell the difference?

    You said the date is inserted by Wordpress to avoid conflicts with Post ID, when you're using the post id only?!

    Because I don't like /date and I still get errors as described above a hundred times ([moronic expletive deleted] Wordpress!) I use the %postname% permlink.

    Right now I have http://www.example.de/titleofarticle and the archivelinks are http://www.example.de/2009/03/.

    I have to import some postings from the time before Web 2.0. They don't have any titles. That's why wordpress gives out the permalink http://www.example.de/923 even i still use postname instead of postid.

    I have to questions in this matter:

    1. What happens with the post that have no title and a page id like 2009?

    2. What happens, if I use the same title twice?

  10. samboll
    moderator
    Posted 8 months ago #

    2. What happens, if I use the same title twice?

    You will likely curse at WordPress some more

  11. TinaR
    Member
    Posted 8 months ago #

    :-(

  12. Otto42
    Moderator
    Posted 8 months ago #

    To answer your questions, Tina:

    1. Best suggestion: Don't do that. All posts need to have a non-numeric slug.

    2. You can't do that, it won't let you. The slug is a unique identifier.

    Note that the "slug" is different from the "title". The slug (internally it's post_name) is the bit of the permalink that's usually auto-generated from the post title.

  13. TinaR
    Member
    Posted 8 months ago #

    Would it be o.k., if I change all the "slugs" in a number starting with 3000 or could this cause trouble in the future?

  14. TinaR
    Member
    Posted 8 months ago #

    I'll get it. Not possible, because the file get's los. Great.

  15. Otto42
    Moderator
    Posted 8 months ago #

    You can change the slug to anything you want, as long as it has alpha characters in it. All numeric slugs cause problems.

  16. compassionateconsiderations
    Member
    Posted 8 months ago #

    Mr Moderator - could you help me please?

    I just migrated from http://compassionateconsiderations.wordpress.com to http://www.compassionateconsiderations.com

    These are my problems:

    1. When I visit the http://www.compassionateconsiderations.com NOTHING works. All my permalinks do not work at all.

    2. But since I am transitioning from a wordpress.com http://compassionateconsiderations.wordpress.com, I still have one of my top posts there with the permalink created throu g h your instructions (custom structure). When I click on that, it will take me to my compassionateconsiderations.com and ONLY then would my permalinks work. Archives, tags, categories, even pages... but the wordpress.com site will be deactivated soon.

    3. I can't seem to do anythin g on my own domain...

    I need help and I have been reading all the codex support but to no avail.

  17. compassionateconsiderations
    Member
    Posted 8 months ago #

    would appreciate any help from anyone.

    email me please: compassionateconsiderations@yahoo.com

    Thanks.

  18. Otto42
    Moderator
    Posted 8 months ago #

    Your new site appears to work fine to me. You have permalinks still set to the defaults, but they work. Go to the Permalinks page and turn on the custom permalinks if you want them, then set your .htaccess correctly.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.