如何通过.htacess将目录名隐藏到最终用户(How can I hide the directory name to the end user via .htacess)
我怎样才能建立这个链接
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 /文章目录将不会由最终用户显示)
https://puaction.com/ {any article name}How can I make this link(s)
http(with or without s)://(with or without www).puaction.com/articles/Top-7-Best-Pheromone-Colognes-for-Menlooks like this :
https://puaction.com/Top-7-Best-Pheromone-Colognes-for-Meneach folder inside articles directory will displayed without the article directory so...
http(with or without s)://(with or without www).puaction.com/articles/(any article)will be (non www / https / article directory will not be displayed by the end user)
https://puaction.com/ {any article name}最满意答案
您可以在root .htaccess中使用此代码:
RewriteEngine On RewriteCond %{THE_REQUEST} \s/+articles/([\S+) [NC] RewriteRule ^ https://puaction.com/%1? [R=301,L,NE] RewriteRule ^([^/.]+)/?$ /articles/$1 [L]You can use this code in root .htaccess:
RewriteEngine On RewriteCond %{THE_REQUEST} \s/+articles/([\S+) [NC] RewriteRule ^ https://puaction.com/%1? [R=301,L,NE] RewriteRule ^([^/.]+)/?$ /articles/$1 [L]更多推荐
发布评论