有人可以帮助将这些nginx规则转换为htaccess吗?我一直在寻找某种网络转换器,但没有运气的......所有的转换器的htaccess到nginx的(((将nginx规则转换为htaccess
我还发现了几个例子
location ~*/member/(join|register|renew|upgrade) {
rewrite ^/(.*) https://www.SOME_DOMAIN1/$1 redirect;
}
location /events {
rewrite ^/(.*) https://www.SOME_DOMAIN1/$1 redirect;
}
location /university/view/ {
try_files $uri $uri/ /tools/CMS/index.php?q=$uri;
}
location ~ ^/workshops/city/ {
try_files $uri /tools/IntensiveWorkshop/iw_city.php?q=$uri&$args;
}
location ~ ^/event-recaps/(\d\d\d\d-\d\d-\d\d) {
try_files $uri $uri/ /tools/Event/index.php?q=$uri&type=recap;
}
location /blog {
try_files $uri $uri/ /3dpart/wordpress/index.php?q=$uri&$args;
}
location/{
index index.php index.html;
root /var/www/SOME_DOMAIN1;
try_files $uri $uri/ /index.php?url=$uri&$args;
}
问题是stackoverflow不允许我把所有的代码,我有那里.. anywya这里是我的htaccess文件...所有在RewriteRule ^成员/只是忽略,不工作......((顺便说一句,它是cPanel/WHM ..我怀疑它使sence .. Apache是版本2。关于波纹管规则,我认为它们的mos可以被简化...一切都是通过index.php在这里,重点是使几个子文件夹在PATH中只能使用https。例如,所有在http://www.example.com/member/之下的东西都应该重写为https://www.example.com/member/ ...
所以如果有人可以帮我做出以下的条件...当URL/member/pattern出现时,它会被重定向到https,这样会可能解决我的问题。这听起来像REquest URI一直包括index.php,这阻止了一些规则的正确工作..不确定。 例如,而不是重定向到/件/搜索/我得到重定向到/index.php?url=/member/search/
RewriteEngine On
Options +FollowSymlinks
## protect .htaccess and everything that starts from a "." dot
<FilesMatch "^\.">
Order allow,deny
Deny from all
</FilesMatch>
## http://nonwww redirects to http://www and https://nonwww redirects to https://www
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s on(s)|
RewriteRule^http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
## everything goes through index.php
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule^/index.php?url=%{REQUEST_URI} [L,QSA]
# here is where it starts to ignore everything
RewriteRule ^member/(join|register|renew|upgrade) https://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^events/ https://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^jobbank/post http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^jobbank/createaccount https://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^techspeak/ http://www.DOMAIN/%{REQUEST_URI} [L,R]
RewriteRule ^newyork-ny http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^longisland-ny http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^sanfrancisco-ca http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^losangeles-ca http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^ralegh-nc http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^portland-me http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteRule ^chicago-il http://www.DOMAIN%{REQUEST_URI} [L,R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog /3dpart/wordpress/index.php?q=%{REQUEST_URI} [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^university/view/ /tools/CMS/index.php?q=%{REQUEST_URI} [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^workshops/city/ /tools/IntensiveWorkshop/iw_city.php?q=%{REQUEST_URI}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^event-recaps/(\d\d\d\d-\d\d-\d\d) /tools/Event/index.php?q=%{REQUEST_URI}&type=recap [L,QSA]
你能否检查并更新信息? – 2014-12-19 16:24:53