我给了一个新的网站设置或重新编写规则。 我从来没有使用过他们,我试图了解我们在这里做什么 RewriteEngine on RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\.myco\.com RewriteRule (.*) http://www.myco.com/$1 [R=301,L] RewriteCond $1 !^(CCSFG|images|fonts|themes|robots\.txt|index\.php) [NC] RewriteRule ^(.*)$ /index.php/$1 [L] 如果我明白这一点,第一个规则集 RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\.myco\.com RewriteRule (.*) http://www.myco.com/$1 [R=301,L] 说: 如果HTTP_HOST是任何东西 如果HTTP_HOST不是以www.myco.com开头的话 然后 重写任何页面请求开始http://www.myco.com/ ,返回301redirect,并停止处理更多的规则 下一个规则集 RewriteCond $1 !^(CCSFG|images|fonts|ee-system|themes|robots\.txt|index\.php) [NC] RewriteRule ^(.*)$ /index.php/$1 [L] 说:如果请求不是以CCSFG,图像或字体或等(不区分大小写)开始,那么重写整个请求以预先添加/index.php/并停止处理更多的规则 我的解释是否正确? 如果是这样,第二个规则集的目的是什么? 为什么我要将/index.php/添加到这些条目中?
我在mywebsite.net上build立了一个网站,但是最近买了域名mywebsite.com。 现在,我通过网站pipe理员工具更新了Google上的信息,并build议我们将.netredirect到.com。 我已经find了如何通过像这样的代码添加到.htaccess中: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 我的问题是,两个域指向同一台服务器,所以我是否正确假设这将尝试redirect,即使我最初访问.com? 如果是这样,那么完成这个的正确方法是什么? 这可能没有关系,但是我不想为我的search排名带来任何问题。 提前致谢!
这是我正在做的事情: 域名是thinkingmonkey.me 域名具有127.0.0.1作为IP地址 mod_alias已安装。 我有一个名为directories.conf的conf文件。 其中我有所有有关目录的configuration。 directories.conf包含在httpd.conf 我的directories.conf有 Alias /runs /xhprof/xhprof_html <Directory /mysite/xhprof/xhprof_html> Order allow,deny Allow from all AllowOverride All </Directory> 在/mysite/xhprof/xhprof_html/.htaccess 。 我有以下几点: RewriteEngine on RewriteBase /runs RewriteRule .* index.php 我所要做的就是将/mysite/xhprof/xhprof_html/下的任何请求指向index.php 。 当我请求不带结尾斜线的 thinkingmonkey.me/runs ,我404 not found 。 所以,我推断RewriteBase不起作用。 我究竟做错了什么?
对于公司活动,我们希望页面只能在2个date之间可用。 有一种方法只允许当前date在两个date之间使用.htaccess访问文件?
我想用Apache 2.4设置LDAPauthentication。 LDAP Sever是Windows 2008。 我的.htaccess看起来像: AuthType Basic AuthName "Login" AuthBasicProvider ldap AuthLDAPBindDN "CN=user,OU=Dienstkonten,DC=company,DC=lan" AuthLDAPBindPassword "pwd" AuthLDAPURL "ldap://dc.company.lan/DC=company,DC=lan?sAMAccountName?sub?(objectClass=*)" NONE require ldap-group CN=Login-Group,OU=Dienstkonten,DC=company,DC=lan 但是我总是得到错误 : (70023)This function has not been implemented on this platform: AH01277: LDAP: Unable to add rebind cross reference entry. Out of memory? 我错了什么? 我如何使用ldap和apache 2.4来validation用户?
有没有办法阻止在日志中显示为“Mozilla”的离线浏览器(如Teleport Pro,Webzip等)? 例如:Webzip在我的站点日志中显示为“Mozilla / 4.0(compatible; MSIE 8.0; Win32)” Teleport Pro在我的站点日志中显示为“Mozilla / 4.0(compatible; MSIE 7.0; Windows NT)” 我做了一些使用.htaccess文件的testing,但是都以浏览器阻塞(Mozilla和Chrome)而告终,当然我不想阻挡正常的访问者,但是只是带有leechers(同时也吃了很多CPU / RAM他们的请求),加上看起来这个离线浏览器甚至忽略robots.txt文件。 任何人都知道一种方法来识别和阻止他们? 如果有可能给我举例。
我有几个不同的虚拟主机创build,每个人都有自己的文件夹在/ var / www /像这样 /var/www/example1/ /var/www/example2/ 现在,当我用www www.example1.cominputurl时,它指向/var/www/example1/index.html所以工作正常,但是当我input没有www example1.com它指向/var/www/和我可以看到所有的文件夹,我没有/var/www/ index.html。 我在这里查看并在/ var / www /中创build.htaccess: RewriteEngine On RewriteBase / RewriteCond % ^example1.com [NC] RewriteRule ^(.*)$ http://www.example1.com/$1 [L,R=301] 但它不工作。 这就是所有虚拟主机的样子: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName *example1* ServerAlias *.*example1* DocumentRoot /var/www/example1 <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/example1/> Options Indexes FollowSymLinks MultiViews AllowOverride All […]
在我们的httpd.conf虚拟主机块中 SetEnv MAGE_RUN_CODE "v2_us_es" 是否有可能在.htaccess文件中使用该variables 就像是 RewriteRule ^sitemap\.xml$ /media/sitemaps/%{MAGE_RUN_CODE}/sitemap.xml [L] 这可能吗? 谢谢! 杰夫 编辑:我查看了以下链接,但他们没有做我想做的事情 在 https://stackoverflow.com/questions/2008123/how-to-use-getenv-in-php-and-setenv-in-a -htaccess-a-compiled-php-cgi-on https://stackoverflow.com/questions/3638637/how-to-use-the-setenv-variable-in-apache
首先,我是Apache .htaccess的全新function。 我有一个服务器,必须允许用户只能潜入mp4和PNG文件。 所以,我一直在阅读Apache HTTP Server文档,根据它说的,我已经把这个添加到了我的.htaccess中: <filesMatch "\.(png|mp4)$"> Order Allow,Deny Allow from all </filesMatch> 因为据我所知,这意味着“对于每个文件,如果它的扩展名是PNG或MP4,允许每个人抓住它,否则拒绝访问”。 很明显,我错了,因为这禁止我访问任何文件/文件夹允许我访问文件夹和HTML文件(以及当然PNG和MP4文件)无论如何。 那么,如何才能访问只有PNG和MP4文件? 另外,我想知道如何使filter忽略大小写。 谢谢。 编辑:首先 – 忘了说,我需要允许本地访问一切(即拒绝必须只为非本地主机)。 我真的不知道这是默认行为还是需要以某种方式表示。 而且,当我进行testing的时候,我有一个损坏的文件,这就是为什么我总是被禁止访问所有的东西。 我已经更新了这个post。
我在我的日志中获取了大量的网页点击,抓取了我网站的大多数顶级页面,并将引用者显示为Java版本。 我在引用中看到Java版本的不同变体,即Java / 1.6.0_04,Java / 1.4.1_04,Java / 1.7.0_25等。 有时候,但并不总是,我得到一个404 /联系/但没有其他页面下面。 根据蜜jar项目,IP通常是垃圾邮件收割机和机器人 78.129.252.190 – – [24/Jan/2014:01:28:52 -0800] "GET / HTTP/1.1" 200 6728 "-" "Java/1.6.0_04" 198 7082 78.129.252.190 – – [24/Jan/2014:01:28:55 -0800] "GET /about HTTP/1.1" 301 – "-" "Java/1.6.0_04" 203 352 78.129.252.190 – – [24/Jan/2014:01:28:55 -0800] "GET /about/ HTTP/1.1" 200 29933 "-" "Java/1.6.0_04" 204 30330 78.129.252.190 – […]