我设法使htaccess在Mac OS X上正常工作,但是子类别规则返回的文件未找到(404),因为我猜是从articles文件夹搜索了吗?
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /ks
RewriteRule ^articles/(.*).html$ articles.cfm?subcateg=$1 [NC,L]
RewriteRule ^articles.html$ articles.cfm [NC,L]
第二个似乎工作正常...
查看您的代码,您的RewriteBase
is/ks/
文件夹,这意味着您可以使用domain.com/ks/articles/xxxxx.html
或来访问它,domain.com/ks/articles.html
并且htaccess位于/ks/
文件夹中。
如果是这样,则应禁用该MultiViews
选项以避免出现问题。
该代码也应在osx上运行
Options +SymLinksIfOwnerMatch -MultiViews
RewriteEngine On
RewriteBase /ks/
RewriteRule ^articles/(.+?)\.html$ articles.cfm?subcateg=$1 [NC,L]
RewriteRule ^articles\.html$ articles.cfm [NC,L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句