Viewing 8 replies - 1 through 8 (of 8 total)
  • Item #9 here has some examples you could tweak:

    21 very useful htaccess tips & tricks
    https://viralpatel.net/blogs/2009/06/21-very-useful-htaccess-tips-tricks.html

    Thread Starter mcfreder

    (@mcfreder)

    thx a lot zoonini, that is exacly what i’m looking for, i’ll try it and reply you back.

    Thread Starter mcfreder

    (@mcfreder)

    RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1

    i must replace product with somethg so as to look like exemple.com/blog/my-wordpress-post-title-id.html

    how to do this ?

    If that’s all you’re trying to do, why not simply go into Settings > Permalinks – choose “Custom Structure” and enter something like this?

    /%postname%%post_id%.html

    Be sure to update your .htaccess as instructed in that area. Note: I have not tested this.

    Also be warned that “Starting Permalinks with %postname% is strongly not recommended for performance reasons”

    Reference:

    https://codex.www.ads-software.com/Using_Permalinks

    Thread Starter mcfreder

    (@mcfreder)

    that’s exacly what i have, now, the problem is that i have both (permalink): which look like exemple.com/blog/post-title-id.html and (old link structure): which look like: exemple.com/blog/?p=id are working !!

    it brings about duplicated content in search engines, that’s why i’m trying to figure out a htaccess redirecmatch to redirect old structure links to the permalink.

    can you help me please, it’s emergency !

    Can you please provide a link to your site?

    exemple.com/blog/?p=id

    will always work. It is the internal url…. The pretty permalinks are a nice looking way to call them

    If your only worry is duplicate content for search enginesm it’s a non-issue pretty much

    You could probably add instructions to your robots.txt if you are concerned about it

    Thread Starter mcfreder

    (@mcfreder)

    thank you for your suggestions, but, it seems you didn’t understand yet,
    i’ll make crysral clear for you: i’m using permalinks links on my wordpress website,but,the default links don’t redirect to permalinks , they are both working ??? can you help me ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘redirectmatch that redirect link ?p=id to post-id.html’ is closed to new replies.