我想在不使用任何 id 的情况下使用 .htaccess 制作一个友好的 url


I want to make a friendly url with .htaccess without using any id

www.example.com/tour_detail/angkor-songsaa-luxury-private-island-honeymoon-premium-tour-19-105.html

注意:19-105是id,所以我不希望它像我想要的那样显示

www.exmaple.com/tour_detail/angkor-songsaa-luxury-private-island-honeymoon-premium-tour

把它放在你的.htaccess中:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^angkor-songsaa-luxury-private-island-honeymoon-premium-tour/?$    angkor-songsaa-luxury-private-island-honeymoon-premium-tour-19-105.html    [NC,L]    # Handle requests for your url

如果您想阅读更多: https://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/