Viewing 3 replies - 1 through 3 (of 3 total)
  • this code use in .htaccess file

    RewriteRule ^https://url.com/1200/postname.html/xyz1a2b3$ “https://url.com/1200/postname.html” [R=301,L]

    Read article link here

    • This reply was modified 4 years, 9 months ago by Anil Ankola.
    • This reply was modified 4 years, 9 months ago by Anil Ankola.
    Thread Starter shidoox

    (@shidoox)

    Thanks,
    But I have many links like this (1000 links) and need one code to work for all.
    I read this article and test this code but not work :

    RewriteRule ^https://url.com/([a-zA-Z-]*).html/([a-zA-Z-]*)$
    https://url.com/(%5Ba-zA-Z-%5D*).html” [R=301,L]

    Thread Starter shidoox

    (@shidoox)

    Ok
    I solved the problem.
    solution:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^([0-9]+)/([A-Za-z0-9-]*).html/([A-Za-z0-9-]*) https://url.com/$1/$2.html [R=301,L]
    • This reply was modified 4 years, 9 months ago by shidoox.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘301 Redirect all Postname.html/xyz” to Postname.html”’ is closed to new replies.