我有一个OS X 10.6安装工作,安装了Apache和PHP。 但是,我不能得到mod_rewrite工作。 我的httpd.conf的内容位于: http : //pastie.org/828990 有谁知道我错过了什么重要的事情?
问题: https://www.example.com – >应redirect到http://www.example.com ,不,给出错误代码:ssl_error_rx_record_too_long不redirect,error_log:“[错误] [客户端127.0.1.3]无效的方法请求\ x16 \ x03 \ x01 https://www.example.com/fundprocess.html – >应redirecthttps://example.com/fundprocess.html ,给出错误代码:ssl_error_rx_record_too_long不redirect,error_log:“[error] [client 127.0.1.3] Invalid方法请求\ x16 \ x03 \ x01“ https://example.com – >应该redirect到http://www.example.com ,不 http://example.com/ – >应该redirect到http://www.example.com ,不 http://example.com/fundprocess.html应该redirect到https://example.com/fundprocess.html ,不 在重写日志中没有条目反对这些错误。 虚拟主机configuration <VirtualHost 127.0.1.3:80> ServerAdmin [email protected] ServerName www.example.com DocumentRoot /var/www/html <Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all […]
我在ServerFault上看到过这个前面的问题 ,我想要类似的东西 ,但我不知道如何完成它。 我想要的是从永久链接中删除所有的斜杠 ,除了域名后面的那个。 例如: http://www.muycomputerpro.com/Actualidad/Especiales/La-Ciudad-Eficiente-Netapp 将被redirect到 http://www.muycomputerpro.com/ActualidadEspecialesLa-Ciudad-Eficiente-Netapp 我需要它来纠正我的WordPress博客下的Apache Web服务器上的一些404错误。 那么,什么是正确的重写规则?
我正在使用一组非常标准的重写规则来redirect到www域。 它在我的一台服务器上工作,但不在另一台服务器上。 我不能为我的生活找出问题,因为其他重写规则工作,除了这一个。 RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC] 有一些Apache的configuration设置,我需要改变,或一些冲突的重写规则?
我想在Apache下的.htaccess文件中使用mod_rewrite进行如下操作: 如果接收到任何文件或path的请求,例如foo.txt或foo/bar ,请检查public子目录中是否存在此文件,例如public/foo.txt或public/foo/bar 。 它如果只是显示该文件。 除此以外 redirect到主控制器index.php 我试图解决的是这样的: <IfModule mod_rewrite.c> RewriteEngine On # Don't rewrite requests for files in the 'public' directory RewriteRule ^(public)($|/) – [L] # For all other files first check if they exist in 'public' RewriteCond %{DOCUMENT_ROOT}/public%{REQUEST_URI} -f RewriteRule ^ public%{REQUEST_URI} [L] # Let 'index.php' handle everything else RewriteRule . index.php [L] […]
.htaccess首先运行良好,然后在我的.htacess中添加了两行来启用RewriteLog。 结果是我没有打开我的网站。 我添加到我的.htaccess的两行如下: RewriteLog /home/bigmeow/mylog/rewrite.log RewriteLogLevel 9 启用rewritelog的.htaccess如下所示: less .htaccess RewriteEngine On RewriteBase /blog/ RewriteLog /home/bigmeow/mylog/rewrite.log RewriteLogLevel 9 RewriteRule ^index\.php$ – [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ – [L] RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L] […]
我正在使用苹果公司提供的PHP 5.3和Apache 2标准安装程序,在我刚刚升级到Mac OS X 10.6(Snow Leopard)的Mac Pro上进行Web开发。 如果我忽视了这样的事实,那就是升级进展得很好,这个事实摧毁了我完成工作的能力。 ;) 更新之后,我开发的CakePHP应用程序在访问时开始给我403个Forbidden错误。 根据日志文件中的错误,我确定Apache在Cake的.htaccess文件中的mod_rewrite规则上窒息了。 这里是整个文件: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> 这不是规则本身是错的,而是Apache禁止使用mod_rewrite。 机器上的所有其他页面都能正常工作,如果我注释掉.htaccess文件,403错误就会消失(当然没有任何效果)。 在我的httpd.conf文件中,我试着改变这个: <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> 对此: <Directory /> Options FollowSymLinks AllowOverride All Order deny,allow Allow from all </Directory> …没有效果 […]
有没有办法在htaccess中使用弹性beanstalk的自定义环境属性? 我只想在不在本地运行时将http重写为https,所以我想我可以通过使用elastic beanstalk的环境属性来做到这一点。 RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
编辑: 如何将所有非活动的子域名redirect到“www”? 在这里,我尝试redirect所有未列出的子域名“www”..我不能让它正常工作,因为%1和%2不返回任何东西..在这里,我试图redirect到google.com只是为了检查返回的%2值..,但它不返回任何内容,redirecturl是http://www.google.com/ RewriteCond %{HTTP_HOST} !^(admin|demo|www)\.([^\.]+\.[^\.]+)$ [NC] RewriteRule ^(.*)$ http://www.google.com/%2 [L,R=301] 这是我真正想要做的 RewriteCond %{HTTP_HOST} !^(admin|demo|www)\.([^\.]+\.[^\.]+)$ [NC] RewriteRule ^(.*)$ http://www.%2/$1 [L,R=301]
好吧,所以我有一个服务器在工作,我正在build立网站。 它有一个WordPress根站点,一个phpBB论坛在一个子目录中,另一个目录中有一个支持站点。 我能够访问phpBB和支持网站,但不能访问wordpress。 服务器:带有LAMP的Ubuntu 11.04。 Mod重写启用。 结构:/ var / www /; / var / www / onlyus /; 在/ var / WWW /支持/ Perms:644处的文件,755处的目录。在777selectcaching,上传等目录.htaccess: <Directory "/var/www"> ///woops, little error there (didn't fix it though) Options +Indexes FollowSymLinks +ExecCGI AllowOverride AuthConfig FileInfo Order allow,deny Allow from all </Directory> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ […]