2017-08-08 79 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