下面的.htaccess配置无法在Wordpress网站上使用屏蔽来实现域重定向:
DirectoryIndex index.php
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?redir2$ [NC]
RewriteRule ^ http://redir1%{REQUEST_URI} [L,NE,P]
Run Code Online (Sandbox Code Playgroud)
这是redir2用于redir1屏蔽的重定向到的.htaccess 。目的是让用户输入例如的redir2/sub投放内容redir1/sub,但显示的网址redir2/sub。
在我的本地安装上运行正常。但是在我的共享主机上,它无需屏蔽即可重定向。我认为问题可能出在服务器配置中。
任何想法可能是什么问题?
只是为了记录,这里是另一个类似的问题,当我使用屏蔽重定向时索引文件出现问题时,我问了以下问题:请求根目录时,使用域屏蔽进行htaccess重定向不起作用
使用其他答案中的解决方案来隐藏外部点击时的 Bootstrap 弹出窗口。
但是,它需要单击两次才能再次打开弹出窗口(如果我通过单击外部关闭它)。
当我使用按钮关闭它时,它可以正常工作并在第一次单击时打开。
这是重新创建的问题:http : //codepen.io/olegovk/pen/BjQmQe
使用的 html:
<!-- Popup button -->
<a id="menu-button" class="menu-button" data-html="true" role="button" data-container="body" data-toggle="popover" data-placement="bottom">Menu</a>
<!-- Popup content -->
<div id="menu-content">
<h1>Hello</h1>
<p>Good bye</p>
<a href="#">Link</a>
</div>
Run Code Online (Sandbox Code Playgroud)
和 jQuery:
$('#menu-button').popover({
content: $('#menu-content').html(),
html: true
});
$('html').on('click', function(e) {
if (typeof $(e.target).data('original-title') == 'undefined' &&
!$(e.target).parents().is('.popover.in')) {
$('[data-original-title]').popover('hide');
}
});
Run Code Online (Sandbox Code Playgroud)
任何想法为什么会发生以及如何使弹出窗口始终在第一次点击时打开?
一个注意事项:我发现无法使用这个“官方”解决方案,因为它无法点击弹出窗口中的链接:http : //getbootstrap.com/javascript/#dismiss-on-next-click