2013-11-25 35 views
0

所以這是內容的原始URL重寫文件夾使用htaccess的

site.com/premium/a/o/test1/ 

我嘗試在.htaccess中使用此但它不工作:

RewriteRule ^premium/a/o/(.*) embed/apple/orange/([^/]*)\.html 

有人可以請給我確切的規則,我需要嗎?

+0

更換是不是正則表達式,因此使用'([^ /] *)'沒有任何意義 - 訪問比賽通過替換中的搜索模式找到,您使用後面的引用:http://httpd.apache.org/docs/2.2/en/mod/mod_rewrite.html#rewriterule(並且轉義點也是錯誤的。) – CBroe

+0

是,我得到這個:未找到。請求的URL /embed/apple/orange/([^/]*).html在此服務器上找不到 – BeBe

回答

1

當你有一組(.*)你可以使用這個後來與$1

RewriteRule ^premium/a/o/(.*)$ embed/apple/orange/$1.html 
+0

是的,它現在工作正常,謝謝:) – BeBe