1

I have been using mod re-write ok up until now.

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...

My problem seems to be that this line gets ignored

# marketing module see newsletter before sending
RewriteRule ^/?(newsletters)/([A-Za-z0-9-]+)/(newsletter)\.html /newsletters/$2/newsletter.html [L]

I am trying to access an html file directly but the folder is a unique name each time.... ie -

http://www.awebsite.co.uk/newsletters/template_4fd09c5b429ea/newsletter.html

This line is being ignored. I do not understand why?

Any help would be much appreciated.

Thanks

Andi

4

2 回答 2

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]

另外,我认为您不需要从位(^)开始。

于 2012-06-07T13:23:12.793 回答
0

好的,我现在开始工作了,。将 / 从重定向的链接中取出

这是我现在的行

# marketing module see newsletter before sending
RewriteRule ^/?(newsletters)/([A-Za-z0-9_]+)/(newsletter)\.html newsletters/$2/newsletter.html [L]

谢谢

和我

于 2012-06-07T13:21:30.670 回答