我在我的apache错误日志文件中得到这些错误: [Fri May 20 16:17:06 2011] [notice] Apache/2.2.17 (Ubuntu) PHP/5.3.5-1ubuntu7.2 with Suhosin-Patch configured — resuming normal operations [Fri May 20 16:17:11 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration [Fri May 20 16:17:12 2011] [alert] [client 127.0.0.1] /home/zomerovic/vhosts/brillelook/public_html/.htaccess: Invalid command 'RewriteCond', perhaps […]
这是一个愚蠢的问题,但有没有Apache的.htaccess文件格式的语法规范? 我所能find的只是“教程”,这不是我想要的。 我想要的是一个.htaccess文件中将被识别的所有有效关键字的列表以及所有有效的参数和函数。 这是否存在?
我在mycompany.tld1上有一个现有的Wordpress站点设置,最近注册了mycompany.tld2。 我想设置从mycompany.tld2到mycompany.tld1的301redirect,那个.htaccess文件是什么样的? 我可以使用条件语句将它附加到Wordpress .htaccess文件中以检查入站URL吗? WP .htaccess(现有): <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
我有这个问题(apache2,Ubuntu的12.04) 我已经把所有我的网站放在/ home / username / vhosts文件夹中我已经添加了家和用户名的权限是x和虚拟主机上的chmod -r 777增加了/ etc / hosts来访问我的站点和所需的名字a2enmod rewrite 但是我仍然有这个错误: [Sat Jun 23 00:05:23 2012] [crit] [client 127.0.0.1] (13)Permission denied: /home/username/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable 为什么它不可读? 我做了 sudo -s su – www-data 和我可以正确列出/ home /用户名目录 我或者Apache有什么问题?
我已经创build了一个PHP文件,应该检测手机或平板电脑。 我从networkingsearch中搜集下面的代码,因为我不知道任何编码,虽然几年前COBOL是我的养家人! 我的PHP文件中的代码是; <?PHP $browser = cge_utils::get_browser(); if( $browser->isMobile() ) { redirect('http://what-do-christians-believe.co.uk/mob_phones'); } if($browser->isTablet()){ { redirect('http://what-do-christians-believe.co.uk/mob_devices'); } ?> 我不知道这是否可行,但所有的事情都是可能的 – 最终! 我一直在search整天没有运气,以找出如何获得这个文件的htaccess文件读取 有人可以告诉我如何编写正确的代码,或者说这个PHP脚本是否可行? 我目前在我的主页中使用Java脚本,但是有人说这会降低手机的上传速度。
我在Apache下面的.htaccess文件redirect所有请求到app/index.php有或没有GET参数。 我刚刚安装了NGINX,我的应用程序将无法运行。 任何人都可以协助在NGINX中复制相同的function吗? 谢谢。 RewriteEngine on Options -Indexes RewriteRule ^$ app/ [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ app/index.php?url=$1 [QSA,L]
我有一个网站,我打算保持约2天的维护模式,而不失去SEO排名。 根据Google的博客文章 ,我们可以通过使用Retry-After标题503 Service Temporarily Unavailable用503 Service Temporarily Unavailable来做到这一点。 我在根目录的.htaccess文件中使用了以下代码(对于503)。 我的问题:如何使用Retry-After标题。 谁能帮我这个? ErrorDocument 503 "Our website is temporarily closed for maintenance." RewriteEngine On RewriteRule .* – [R=503,L]
我对nginx和owncloud有问题。 当我访问owncloud的login页面,我得到这个错误: 您的数据目录和您的文件可能从互联网上访问。 ownCloud提供的.htaccess文件不起作用。 我们强烈build议您以不能再访问数据目录的方式configurationWeb服务器,或者将数据目录移到Web服务器文档根目录之外。 这是我的虚拟主机文件: server { listen 80; server_name default_server; root /usr/share/nginx/www; index index.html index.htm; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } […]
我有一个使用HostGator上托pipe的CloudFlare灵活SLL的网站。 我想将所有 HTTP请求redirect到相应的HTTPS URL。 没有例外。 我打算把规则放在最上面,所以在处理完所有后面的重写规则的时候不应该testing。 我目前的代码是这样的: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] 但是这会导致无尽的redirect到HTTPS版本。 这里是FireFox Live HTTP Headers: https://example.net/ GET / HTTP / 1.1 主持人: example.net 用户代理: Mozilla / 5.0(Windows NT 10.0; WOW64; rv:51.0)Gecko / 20100101 Firefox / 51.0 接受: text / html,application / xhtml + xml,application / xml; q = 0.9, […]
我有一个带密码保护的Web目录的Apache服务器。 该目录有一个子目录,它需要另一个密码,但任何可以访问该子目录的人都应该可以访问父目录。 那是: /东西 – 用户“东西”和“pipe理”允许 / stuff / admin – 只允许用户“admin” 所以我在Apacheconfiguration中这样设置: <Directory "/stuff"> [AuthType Basic, AuthName, etc.] Require user stuff Require user admin </Directory> <Directory "/stuff/admin"> [AuthType Basic, AuthName, etc.] Require user admin </Directory> 这个作品的意思是我可以浏览到/东西,并以“pipe理员”或“东西”login。 但是,/ stuff / admin中的页面会引用父目录中的一些图像。 我发现,当我直接浏览到/东西/pipe理和login作为“pipe理”浏览器仍然提示我另一个密码来加载这些图像。 (我知道这是/ stuff的提示,因为AuthName的值是不同的。) 如何避免这种情况,并允许有权访问/ stuff / admin的用户只login一次(如“admin”),而不是两次?