到目前为止,我一直在使用mod重写ok。
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^/?(shopping-catalogue)/([0-9]+) index.php?friendly_url=$1&view=catalogue&catalogue_id=$2 [L]
RewriteRule ^/?(shopping-catalogue)/(category)/([0-9]+) index.php?friendly_url=$1&view=$2&category_id=$3 [L]
RewriteRule ^/?(shopping-catalogue)/(category-item)/([0-9]+) index.php?friendly_url=$1&view=$2&category_item_id=$3 [L]
RewriteRule ^/?(shopping-catalogue)/(category-item-option)/([0-9]+) index.php?friendly_url=$1&view=$2&category_item_option_id=$3 [L]
# marketing module see newsletter before sending
RewriteRule ^/?(newsletters)/([A-Za-z0-9-]+)/(newsletter)\.html /newsletters/$2/newsletter.html [L]
RewriteRule .([^/]+)\.html index.php [L]
#RewriteRule ^/client-area/CLID/([0-9]+) /index.php?temp=template_dataroom&CLID=$1 [L]
# allow access with no restrictions to local machine at 192.168.1.3
RewriteCond %{REMOTE_ADDR} !192.168.1.3
# allow access to all .css and .js in sub-directories..
RewriteCond %{REQUEST_URI} !\.css$
RewriteCond %{REQUEST_URI} !\.js$
# allow access to the files inside img/, but not a directory listing..
RewriteCond %{REQUEST_URI} !dataroom/(.*)\.
RewriteRule ^files/([^/]+)/([^/]+).zip /download.php?section=$1&file=$2 [NC]
# allow access to these particular files...
我的问题似乎是这一行被忽略了
# marketing module see newsletter before sending
RewriteRule ^/?(newsletters)/([A-Za-z0-9-]+)/(newsletter)\.html /newsletters/$2/newsletter.html [L]
我正在尝试直接访问html文件,但每次该文件夹都是唯一的名称....即 -
http://www.awebsite.co.uk/newsletters/template_4fd09c5b429ea/newsletter.html
此行被忽略。我不明白为什么?
非常感谢任何帮助。
由于
岸堤
答案 0 :(得分:0)
以下是我现在的行
# marketing module see newsletter before sending
RewriteRule ^/?(newsletters)/([A-Za-z0-9_]+)/(newsletter)\.html newsletters/$2/newsletter.html [L]
由于
岸堤
答案 1 :(得分:0)
我没有检查结果,但你似乎没有允许下划线
RewriteRule ^/?(newsletters)/([A-Za-z0-9-]+)/(newsletter)\.html /newsletters/$2/newsletter.html [L]
RewriteRule (newsletters)/([A-Za-z0-9|-|_]+)/(newsletter)\.html /newsletters/$2/newsletter.html [L]
另外,我认为你不需要以bit(^)开头。