我想强制https和服务器状态输出(mod_status)的基本身份validation。 如果我启用身份validation,用户请求http://site/server-status Apache首先要求通过,然后redirect到httpS,然后再次要求通过。 这个问题类似于Apache – 在AUTH之前redirect到https, 在.htpasswd之前强制https与apache,但是我无法得到它的工作,因为我们讲的不是通用文件夹,而是位置结构。 我的configuration(简称)如下: <Location /server-status> SSLRequireSSL <IfModule mod_rewrite.c> RewriteEngine on RewriteBase /server-status RewriteCond %{HTTPS} off RewriteCond %{SERVER_PORT} 80 RewriteRule ^ – [E=nossl] RewriteRule (.*) https://site/server-status} [R=301,L] </IfModule> SetHandler server-status Order deny,allow Deny from all Allow from localhost ip6-localhost Allow from 1.2.3.0/24 Allow from env=nossl AuthUserFile /etc/httpd/status-htpasswd AuthName "Password protected" AuthType […]
我试图设置Nginxconfiguration自动redirect到我的静态子域(site.domain.com)任何域/子域指向(CNAME)到/ var / www内的相应目录。 该目录将以指定的域名/子域名命名。 每当有人添加新域名时,我不想使用VirtualHost或更改/重新启动Nginx。 我偶然发现了这个答案,但是我还是不太明白。 我应该设置为根目录? 当前configuration: server { server_name site.domain.com; listen 80 default_server; root /var/www/; index index.html index.htm; }
我试图创build一个组合“超级caching” – >文件 – >模块模式与try_files(“超级caching”从wordpress超级caching采取,因为它是一个类似的方法)。 适用于caching的文件位于“caching”文件夹内。 如果文件存在于其中一个位置,则应该提供该文件。 / $caching$ URI / $caching$ URI / $ URI $ URI / 1.cache – > 2.file – > 3.pattern location / { try_files /$cache_dir$uri /$cache_dir$uri/ $uri $uri/ /index.php; } 地址为“domain.com/css/style588.css”的示例 寻找/srv/www/domain.com/public_html/cache /css/style588.css 寻找/srv/www/domain.com/public_html/cache /css/style588.css /index.html&.php 寻找/srv/www/domain.com/public_html /css/style588.css 寻找/srv/www/domain.com/public_html /css/style588.css /index.html&.php 如果没有find:/srv/www/domain.com/public_html /index.php 我试图使它与下面的configuration工作。 我究竟做错了什么? 包括来自nginx.conf的domain.conf server { ## […]
我正在GitList (Git的PHP web浏览器)和GIT智能HTTP(S)在同一域git.domain.ext下。 以下是实际设置: GIT智能HTTPurl格式为git.domain.ext / git / reponame.git GitList通过git.domain.ext / gitlist来提供 到现在为止还挺好。 一切正常。 我想达到的是以下几点: 任何forms的git.domain.ext / *。git的请求应该改为git.domain.ext / git / *。git 任何其他请求应该默认为git.domain.ext / gitlist 以下是我的Apacheconfiguration: <VirtualHost *:443> ServerName git.domain.ext DocumentRoot /home/user/www/git.domain.ext SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER SetEnv GIT_PROJECT_ROOT /home/user/git/ SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ <Location /> AuthName "Git Authentication" AuthType Basic Require valid-user AuthUserFile /home/user/git/.htpasswd </Location> <LocationMatch […]
我工作的网站有这两页: http://www.africananimals.com/stripes/zebras 和 http://www.africananimals.com/news/zebras (这些不是真正的域名,只是例子。) 目录结构最近被重新组织,并且相同页面的URL改为: http://www.africananimals.com/zebras/stripes 和 http://www.africananimals.com/zebras/news 我想要一个mod_rewrite规则(或者更less资源的替代方法,比如Redirect命令或类似的东西)来使那些同时拥有旧url的页面的爱好者受益。 我需要这个工作http // www.africananimals.com和http // africananimals.com /版本的URL。 我的解决scheme是这样的: Redirect /stripes/zebras http://www.africananimals.com/zebras/stripes Redirect /news/zebras http://www.africananimals.com/zebras/news – 但我不确定我是否正确 在正则expression式上很糟糕,对.htaccess只有肤浅的理解,我一定会感激一些指导。
我正在尝试设置redirect/重写,以便以/(尾随斜线)结尾(为了使search引擎友好)。 但是还有其他的内部重写,它们在浏览器地址栏中没有显示。 我希望能够首先在地址栏上拖尾/然后执行这些内部重写。 当我尝试把这个规则在开始,所有的内部重写得到显示在地址栏中: 目前我有重写规则: `url.rewrite-once = ( ^/([0-9_-]+)(?:\?(.*))?" => "/path/www/index.php?cmd=alias&target=$1&$2", <second condition> => <relative uri> <third condition> => <relative uri> )` 这是我想要添加的规则。 使用的规则: url.redirect = ("^(.*[^/])$" => "$1/") 但是这也显示了我的url的内部path。 例如: www.tikejhya.com/path/www/index.php?cmd=alias&target=hellow/world&/ 我只是想添加一个结尾的斜杠(在地址栏中可见),而其他所有东西都不变。 仅供参考:我的模块也是正确的顺序,我尝试guglling(mod_rewrite / fastcgi和别名与redirect)任何指针在正确的方向将不胜感激。
我需要通过Web代理强制一个特定的HTTP请求,而其余的HTTP请求应该直接到Web服务器。 我可以使用错误代码305 Use Proxy response来redirect我的客户端,但我不确定这是否会被我的客户端的基础HTTP堆栈支持。 有没有其他的select来完成这个?
我需要将所有请求redirect到一个维护页面,除了特定的URL,仍然可以让我有可能访问正常的网站。 我GOOGLE了,但我没有find任何东西。 现在我正在redirect: RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f RewriteCond %{REQUEST_FILENAME} !/maintenance.html RewriteRule ^.*$ /maintenance.html [L] 通常(因为现在它被注释掉了)我使用jk_mod的Apache后面的Tomcat 6: <IfModule mod_jk.c> JkMount / worker1 JkMount /* worker1 </IfModule> 但是如何授予通过特定的URL访问正常的网站的可能性呢?
我有一个IIS应用程序和三个子应用程序,如下所示: CMT (Windows and Anonymously authenticated) – CI – EM – Website (Windows authenticated) CI和EM是帮手Web服务,网站 – 显然是网站。 现在,如果应用程序托pipe在cmt.mycompany.com下,则用户可以访问该网站,如下所示: cmt.mycompany.com/website/mypage 我想写一个URL Rewrite规则,这样我们的用户就不用在DNS之后写'网站',只需打开cmt.mycompany.com或者cmt.mycompany.com/mypage打开主页或者mypage,分别。 <rule name="WebsiteMapping" stopProcessing="true"> <match url="^(?!\b(?:ci|em|website)\b).*$" /> <action type="Rewrite" url="http://{HTTP_HOST}/website/{R:0}" logRewrittenUrl="true" /> </rule> 这条规则所做的只是简单地重写任何不以ci , em或website开头的url,以便在DNS之后添加website 。 我有两个问题,我似乎无法解决: 出于某种原因,URL重写似乎无法与身份validation,所以无论何时我打cmt.mycompany.com ,我得到一个对话框要求我authentication自己,即使我input我的凭据它不起作用。 由于主应用程序(CMT)和网站托pipe在不同的应用程序池中,因此我们需要安装IIS ARR,但这并没有帮助。 我试图改变规则“redirect”,它确实工作,但还有一个问题。 所以我有一个负载平衡器连接到4个独立的盒子。 负载均衡器托pipe在端口80下,但各个盒子托pipe在端口9991.当我点击各个盒子时,URLredirect工作成功,但是当我点击负载平衡器dns时,端口9991(单个盒子)被追加到负载均衡器的DNS! 例如,如果我点击了cmt.mycompany.com/mypage ,我会被redirect到cmt.mycompany.com:9991/website/mypage ,这显然是无效的,因为负载平衡器托pipe在端口号80而不是9991。 任何想法来帮助我解决这些问题? 谢谢!
我在我的Ubuntu服务器上使用Openpanel(完全更新/升级昨晚),我有一个小问题,我敢肯定不是所有的configuration文件都包含在内,因此导致问题不redirect,不加载我的caching控制标题。 这看起来不太合适(这是它用来包含我的其他configuration的正则expression式) Include /etc/apache2/openpanel.d//davemackintosh.co.uk.inc/[^.#]* 而我的davemackintosh.co.uk.inc文件正在通过Apacheconfigurationtesting,我只是不认为他们被列入。 caching.conf proxy.conf <– This is definitely included otherwise my site wouldn't be up redirects.conf 除非我的configuration不正确,所以在这里他们是: caching.conf #Disable Last-Modified Response Header <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|html|rpc)$"> Header unset Last-Modified </FilesMatch> #Default Cache-control header for most static files <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=7200, public" </FilesMatch> # Revalidate For No-cache files each time <FilesMatch "\.nocache\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> […]