好吧,我需要添加一个exception! 我怎样才能做到这一点? 我目前使用RewriteRule ([^.]+).html $1 [R=301,L]来重写所有的.htmlurl 我确实需要google.htmlvalidation文件的例外。 我怎样才能设置这个exception? 我试过这个,但它不工作。 有任何想法吗? RewriteCond $1 !^(google022e525bdb654772.html|googleb5e92d18c6640aeb.html)/? 我试了 RewriteCond $1 !^(google022e525bdb654772.html|googleb5e92d18c6640aeb.html)
我已经inheritance了一个Web应用程序,并且在下面是一组.htaccess规则。 在我看来,他们什么都不做。 有人可以解释他们在做什么吗? 对我来说,它看起来像只匹配到站点根目录,检查目录是否不存在(!),然后301redirect到站点根目录。 RewriteCond %{REQUEST_URI} /$ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301]
我有WordPress安装在我的根目录,为此RewriteRule的地方。 我需要密码保护一个子文件夹(“蓝色”),所以我在这个文件夹中设置htaccess。 问题是,根htaccess RewriteRule应用于“蓝色”,因此我得到一个404在主WordPress站点(而不是打开子文件夹的密码对话框)。 这里是根htaccess: RewriteEngine on <Files 403.shtml> order allow,deny allow from all </Files> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 我尝试插入这个作为第二行,无济于事: RewriteRule ^(blue)($|/) – [L] 还尝试在index.php之前插入这个RewriteRule: RewriteCond %{REQUEST_URI} !^/blue/ 那也行不通。 还插入到子文件夹的htaccess中,这也没有工作: <IfModule mod_rewrite.c> RewriteEngine off </IfModule> 有任何想法吗?
我在这种情况下: url: domain/var1/var2/var3/…/varn 我想在以下url中更改该url: url: domain?v1=var1&v2=var2&v3=var3/…/&vn=varn 我发现这样: RewriteRule domain/([^/]+)/([^/]+)$ domain/index.php?v1=$1&v2=$2 [QSA,NC] 但是,正如你所看到的,我必须手动指定所有的variables…有没有办法自动做到这一点? 类似于:有一个/([^/]+)加v{N}=${N} ? 谢谢
我有一些这样的重写规则 RewriteRule ^dir/(.*)-something.html otherdir/file1.php?var1=val&var2=$1 [L,NC] RewriteRule ^dir/ otherdir/file2.php?var1=val [L,NC] 目录/不是一个真正的目录。 以上的一切按预期工作。 但是,用户可以input类似的东西 mysite.com/dir/asdfasdfasdfsdf 他们仍然redirect到file2.php。 如果用户只是input垃圾,我想用404代替。 我猜测我需要一个RewiteCond来testing斜线后面的空格,然后才能提供file2.php,但是我不确定如何编写它。
我的网站根目录中有一个.htaccess,如下所示: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain\.pl [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?([a-z0-9_-]+)\.mydomain\.pl [NC] RewriteRule ^/?$ /index.php?run=places/%1 [L,QSA] RewriteCond %{REQUEST_URI} !^/index.php$ RewriteCond %{REQUEST_URI} !^/images/ RewriteCond %{REQUEST_URI} !^/upload/ RewriteCond %{REQUEST_URI} !^/javascript/ RewriteRule ^(.*)$ /index.php?runit=$1 [L,QSA] 我已经在文件夹客人安装了自定义留言簿,现在我想要禁用上面这个特定文件夹的规则。 所以当我input: mydomain.pl/guests 我想正常去实际文件夹的客人。 我知道我需要以某种方式禁用客人子文件夹上面的规则,但我该怎么做?
最近我注意到我的服务器一直在通过netstat -na发送数据到奇怪的位置“121.11.76.48”。 为了找出它发送的是什么,我试了一下: tcpdump -i eth0 host 121.11.76.48 -nnvvXSs 1514 并发现它不断发送HTTP请求到这个位置: 22:55:21.179353 IP (tos 0x0, ttl 64, id 26103, offset 0, flags [DF], proto: TCP (6), length: 296) 192.168.1.13.58155 > 121.11.76.48.80: P, cksum 0x880b (incorrect (-> 0xd884), 1904784743:1904784999(256) ack 915059568 win 46 0x0000: 4500 0128 65f7 4000 4006 4ce8 c0a8 010d E..(e.@[email protected]….. 0x0010: 790b 4c30 […]
我有三个站点在一个共享主机(Bluehost)中运行一个专用的IP地址。 说明如下: example.com =>这是主站点和域名,是一个WP example.net =>这是一个附加域名(不知道你是否熟悉这个术语),并正在运行另一个WP站点 subsite.example.net =>这是一个独立的PHP应用程序 每个WP都有它自己的.htacess文件,如下所示: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 有了这个.htaccess文件,两个WP网站都可以正常工作,但独立的应用程序却没有。 如果我删除.htaccess文件然后是相反的,独立的应用程序工作,但WP网站没有。 有没有可以帮助我find解决这个问题? 更新 我正在使用独立PHP应用程序的.htaccess文件的以下configuration: <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond […]
我试图得到一个简单的万维网。 到非www。 redirect设置。 这是.htaccess DirectoryIndex index.php RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.org [NC] RewriteRule ^(.*)$ http://domain.org/$1 [L,R=301] RewriteBase / ########## Begin – Rewrite rules to block out some common exploits ## If you experience problems on your site block out the operations listed below ## This attempts to block the most common type of exploit `attempts` […]
我们有https://example1.com/login和example2.com/login从同一个Apache服务器(2.2.22)托pipe。 我想限制/login example1.com 。 example1.com/login – > 404(最好)或403 example2.com/login – >login页面 我试过了 <Location /login> Order Deny,Allow Deny from example1.com Allow from example2.com </Location> 它禁用/login example1.com和example2.com 。 我可以限制example1.com吗?