- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我发现了上千个其他主题寻求帮助,但由于某种原因,他们的解决方案似乎都不起作用。
我几天前刚刚为我的域购买了 SSL,因为我在我的网站上接受信用卡/支票卡,我希望我的客户感到安全。
无论如何,这就是我的 .htaccess 文件目前的样子:
php_flag display_startup_errors off
php_flag display_errors off
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^buy-wow-accounts index.php [NC]
RewriteRule ^sell-wow-accounts sell.php [NC]
RewriteRule ^about-khaccounts about.php [NC]
RewriteRule ^buy-sell-wow-accounts-faq faq.php [NC]
RewriteRule ^khaccounts-feedback feedback.php [NC]
RewriteRule ^payment-plan payment-plan.php [NC]
RewriteRule ^customer-login customer-login.php [NC]
RewriteRule ^customer-center customer-center.php [NC]
RewriteRule ^privacy-policy privacy.php [NC]
RewriteRule ^buy-world-of-warcraft-wow-accounts/page-([0-9]+) listing.php?pageid=$1 [L,NC]
RewriteRule ^buy-world-of-warcraft-wow-accounts listing.php [L,NC]
RewriteRule ^world-of-warcraft-wow-acc/([^/]*)\.html$ account.php?acc=$1 [NC]
我想做的是强制 WWW(如果它不在 URL 中)并确保也强制使用 HTTPS (SSL)。我有大量指向我网站的链接,其中大部分只是“www.khaccounts.net”、“http://khaccounts.net”和“khaccounts.net”之类的链接。
我想确保这些不同的旧链接中的每一个都将被迫拥有 WWW 和 HTTPS。换句话说,我希望人们拥有 URL -“https://www.khaccounts.net”,无论他们使用什么 URL 访问我的网站。
谢谢!
最佳答案
在您的 www 规则添加之后:
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
此外,将您的 www 规则更改为 https://
,这样就不会有 2 个重定向。
关于.htaccess - 在 .htaccess 中强制使用 WWW 和 HTTPS (SSL) -- 需要帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11975519/
是否可以在 .htaccess 中包含来自另一个 htaccess 文件的规则? .htaccess RewriteEngine On RewriteCond ... RewriteRule ...
我正在尝试做的事情: 在我的特定项目的服务器上,我想通过 htaccess 编写 URL 重写规则(从 URL 中删除 .php 或 .html 扩展名)。 我的网站网址: http://enacte
在我的 .htaccess 文件中我已经有一些重写条件和规则,并且它工作正常。 现在我需要将“http 到 https 重定向”添加到我的 htaccess 文件中。 这是我的旧 .htaccess
注意:我写了解决方案。不管怎样,谢谢你。 :) 我知道这似乎是重复的问题:我搜索了很多,我应用了数十条重写规则,但它们不起作用。 我需要从 重定向 www.domain.com/folder1 到 w
我有一个带有 drupal 的多站点,我创建了一个站点,该站点起初应该可以通过多种方式(子域和路径)访问,但现在我只想保留其中一个;所以我应该重定向所有其他人。现在我有: aaa.domain.com
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
我将我的网站从/v1/etc... 目录移动到/v2/etc... 目录,并希望在 htaccess 中进行永久重定向。有人能帮我吗? 最佳答案 您可以使用 mod_rewrite : Rewrite
我想通过 .htaccess 保护文件夹。以下不起作用。它在浏览器中显示登录对话框,但看起来好像用户名和密码不匹配。当我将方法更改为 Basic 时,它运行良好。 AuthUserFile /home
任何人都可以解释以下行吗? RewriteRule ^(.*)$ /index.php/$1 [L] 最佳答案 重写规则的部分分解如下: 重写规则 表示此行将是重写规则,而不是重写条件或其他重写引擎指
我正在尝试从一个域中一个目录中的所有文件创建一个永久的 htaccess 重定向(301)到另一个域,如下所示: 重定向以下目录中的所有文件: http://www.primary.com/apple
我不是 .htaccess 的英雄,但我遇到了一个我认为可能是由它引起的问题。 第一个症状:对我的数据库的简单更改(如用户 IP 跟踪)每次请求都完成了多次,而站点的输出看起来还不错。 经过数小时的跟
我想做一个类似basecamp.com的东西:你公司的名字变成三级域名,http://mycompany.basecamp.com例如。我知道它(很可能)是在.htaccess文件和mod_rewri
我已阅读 this这对我的要求来说似乎太长了。 并尝试过 Redirect /index.php /index2.php但它不起作用(内部服务器错误) 我想要的是将我的一些 php 文件重定向到 in
如果使用此代码,则成功: Redirect 301 /products.php http://website.com.au/product_123.php 但是,如果执行此操作,则不是: Redire
我想重定向这个子域: http://abc.domain-name.com 到根域上使用相同名称的文件夹: http://www.domain-name.com/abc 这样,如果我尝试访问以下文件:
我已经在我的实时站点上设置了 htpasswd 身份验证,并且效果很好,但是当我在开发环境中工作时,我不想被要求输入密码。 在我的 httpd.conf 文件中,我有: SetEnv APP_ENV
之前 我安装了 SSL,一切运行良好!!这是我的根网络服务器 .htaccess 文件中的代码: Options +MultiViews RewriteEngine On RewriteCond %{
我要问一个非常简单的问题。当我运行我的页面时,我不希望我的链接显示这个: http://localhost/example/assets/gallery.php 我想要的是: http://local
我在 htaccess 中有说明,可以让所有请求都通过 index.php 文件。但它禁止访问文件夹和文件。因此,如果我尝试转到/uploads/products/thumbs/file.png 它会
我有一个这样的网址:https://example.com/coins/1&order_by=today以及几个类别,例如: https://example.com/coins/1&order_by=
我是一名优秀的程序员,十分优秀!