Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 135247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:45:33+00:00 2026-05-11T06:45:33+00:00

I’m trying to have SEO friendly URLs for my wordpress blog, while still having

  • 0

I’m trying to have SEO friendly URLs for my wordpress blog, while still having the flexibility to change a post’s title at will.

My permalink structure would be like this:

%post_id%/%postname%

However, I’d like wordpress to just consider the %post_id% from the URL when looking for the appropriate post (sort of like here on stackoverflow)

For example:

https://stackoverflow.com/users/810/crossbrowser is the same as https://stackoverflow.com/users/810/hello-world

I’d like all of these to point to the same post, the one with id 345:

http://myblog.com/345/the-name-of-the-post http://myblog.com/345/any-text http://myblog.com/345 

The documentation mentions something that seems like what I’m trying to do: Long permalinks, but I couldn’t get it to work.

Here’s my .htaccess file:

RewriteEngine on RewriteBase /  # Let wordpress use pretty permalinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]  # From the example in the documentation #RewriteRule /post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA] 

UPDATE

I keep trying this RewriteRule in this online regular expression testing tool, but it doesn’t work when I put it in my .htaccess (just after RewriteBase):

RewriteRule ^([0-9]+)/?([a-zA-Z0-9\-]+)/?$ index.php?p=$1 [QSA] 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:45:33+00:00Added an answer on May 11, 2026 at 6:45 am

    My response does not directly answer your question, but I think I have some points worth noting.

    I’m trying to have SEO friendly URLs for my wordpress blog, while still having the flexibility to change a post’s title at will.

    I’m not immediately seeing the benefit of your pursuit.

    The obvious disadvantage of including the %post_id% is that it makes the URL longer and contains non-semantic information. WordPress already deals with the scenario in two ways:

    1. The url (permalink/post name) doesn’t change when you change the title on a published post.

    2. If you do change the permalink, the old permalink continues to work and redirects to the new permalink.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.