如何建立此链接
http(with or without s)://(with or without www).puaction.com/articles/Top-7-Best-Pheromone-Colognes-for-Men
看起来像这样:
https://puaction.com/Top-7-Best-Pheromone-Colognes-for-Men
文章目录中的每个文件夹都会显示,而不显示文章目录...
http(with or without s)://(with or without www).puaction.com/articles/(any article)
将是(最终用户不会显示非www / https / article目录)
https://puaction.com/ {any article name}
答案 0 :(得分:0)
您可以在root .htaccess中使用此代码:
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+articles/([\S+) [NC]
RewriteRule ^ https://puaction.com/%1? [R=301,L,NE]
RewriteRule ^([^/.]+)/?$ /articles/$1 [L]