1
我想知道是否有办法实现这种URL重写;如果页面存在于子文件夹中,则重写URL
RewriteRule ^example-link-1?$ /blog/example-link-1 [NC,L]
RewriteRule ^example-link-2?$ /blog/example-link-2 [NC,L]
RewriteRule ^example-link-3?$ /blog/example-link-3 [NC,L]
RewriteRule ^example-link-4?$ /blog/example-link-4 [NC,L]
,你直接去如example.com/example-link-1
链接,你实际上是从example.com/blog/example-link-1
显示的内容,而无需每页我添加新的规则。有没有一种动态的方式来做到这一点在htaccess中?即;如果存在('blog /'+ pageURI) 那么重写为'blog /'+ pageURI,但保留没有'blog /'的uri在其中。
完美谢谢! – Jai
不客气,很高兴它的工作。 – anubhava