【发布时间】:2014-11-07 17:54:53
【问题描述】:
我正在尝试在 wamp/www/myDirectory 中创建 .htaccess 文件。
但我无法创建,上面写着'you must type file name'
我也启用了 mod-rewrite。现在我想检查 URL 隐藏,但我无法创建 .htaccess。
我已经创建了 .htaccess 文件并编写了这样的代码
# Avoid redirect loop
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
# Add trailing slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://%{HTTP_HOST}/$1/ [R=302,L]
RewriteRule ^purchase(.*)$ $1 [R=302,L]
RewriteCond %{REQUEST_URI} !^/purchase/
RewriteRule ^(.*)/$ purchase/$1 [L,QSA]
我该怎么做。请推荐
【问题讨论】: