[英]301 redirects on WHMCS
I have installed WHMCS in a subdirectory, domain.com/whmcs我已经在子目录domain.com/whmcs中安装了 WHMCS
Now I am moving it into the main domain and I will be using custom pages.现在我将它移到主域中,我将使用自定义页面。 However, i don't want to have .PHP extension on the custom pages that I created.
但是,我不想在我创建的自定义页面上有 .PHP 扩展名。 Ex.
前任。 domain.com/page.php
domain.com/page.php
I will need to remove .PHP extensions from specific pages and redirect these pages to non .PHP versions.我需要从特定页面中删除 .PHP 扩展名,并将这些页面重定向到非 .PHP 版本。
I just want to double check if this is the right 301 redirect for the search engines, before i publish it:在发布之前,我只想仔细检查这是否是搜索引擎的正确 301 重定向:
RewriteEngine on
RewriteRule ^mypage$ mypage.php [L]
Redirect 301 /mypage.php https: //domain.com/mypage
It works perfectly when i type domain.com/mypage.php redirects to domain.com/mypage But i am not sure if it's the right way to do it for the search engines.当我输入domain.com/mypage.php重定向到domain.com/mypage时,它工作得很好但我不确定这是否是搜索引擎的正确方法。 Currently i use wordpress in the root domain, so basically, I want to match the same links.
目前我在根域中使用 wordpress,所以基本上,我想匹配相同的链接。
Thanks!谢谢!
Just use this to redirect xyz.php
to xyz
:只需使用它来将
xyz.php
重定向到xyz
:
Redirect 301 /xyz.php /xyz
As far as I know about search engines, its better to use a 302
redirect to avoid a ' permanent ' issue.据我对搜索引擎的了解,最好使用
302
重定向来避免“永久”问题。
Make sure that /xyz
actually shows a valid page.确保
/xyz
实际显示有效页面。 So that you do not mess up with the search engines due to a simple mistake like that.这样您就不会因为这样的简单错误而弄乱搜索引擎。
In your example, you use both mod_rewrite and mod_alias .在您的示例中,您同时使用mod_rewrite和mod_alias 。 One of them is enough.
其中一个就足够了。
RewriteCond
, RewriteRule
... are from mod_rewrite RewriteCond
, RewriteRule
...来自mod_rewriteRedirect
, RedirectMatch
... are from mod_alias Redirect
, RedirectMatch
...来自mod_alias Always, test it once before working on a production server.始终,在生产服务器上工作之前对其进行一次测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.