2017-08-08 48 views
0

我试图表现出http://example.com/seller/samsung/about.phphttp://example.com/about.php内容,其中三星是一个动态不存在的文件夹。我曾尝试下面的代码:htaccess的 - 地图动态路径

RewriteRule ^seller/([^/]+)/(.*)$ ./$1

它的工作原理,当我做手工是这样的:

RewriteRule ^seller/samsung/(.*)$ ./$1

+0

喜@anubhava,我试图展示使用此代码http://example.com/seller/samsung/about.php下的http://example.com/about.php的内容:RewriteRule^seller /([^/]+)/(.*)$ ./$1其中([^ /] +)我相信定义了一个动态路径,但它不会工作。有任何想法吗? – Carl

回答

0

应该[^/]+没有括号()

RewriteRule ^seller/[^/]+/(.*)$ ./$1