我需要从客户旧站点到新站点的永久重定向,重定向是从 hissite.eu 到 newsite.com,相同的托管但其他域。现在,他希望仍然可以通过某个子域访问他的旧站点,如果我可以让它工作,这不会有问题,但是旧站点是用自定义 CMS 制作的,很多硬编码,如果我移动它就不起作用到任何目录。
所以我的问题是,如果我从 oldsite.eu 永久重定向到 newsite.com,我怎样才能让他访问他的旧网站?如果他键入 IP 地址而不是域,是否有可能以某种方式不重定向,但我想再次管理面板不起作用。是否可以对除特定 ip 之外的所有人进行重定向?
使用当前的 htaccess 更新:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Rewriterule ^index$ index.php [L]
Rewriterule ^login$ login.php [L]
Rewriterule ^register$ register.php [L]
Rewriterule ^classified_new$ classified_new.php [L]
Rewriterule ^account_classifieds$ account_classifieds.php [L]
Rewriterule ^account_classifieds_manage$ account_classifieds_manage.php [L]
Rewriterule ^account_confirm$ account_confirm.php [L]
Rewriterule ^account_details$ account_details.php [L]
Rewriterule ^account_invoice_browse$ account_invoice_browse.php [L]
Rewriterule ^account_invoice_details$ account_invoice_details.php [L]
Rewriterule ^account_main$ account_main.php [L]
Rewriterule ^account_messages$ account_messages.php [L]
Rewriterule ^account_profile$ account_profile.php [L]
Rewriterule ^ajax_request$ ajax_request.php [L]
Rewriterule ^classified_browse$ classified_browse.php [L]
Rewriterule ^classified_details$ classified_details.php [L]
Rewriterule ^classified_new_form$ classified_new_form.php [L]
Rewriterule ^classified_new_premium$ classified_new_premium.php [L]
Rewriterule ^classified_payment$ classified_payment.php [L]
Rewriterule ^classified_new_confirmation$ classified_new_confirmation.php [L]
Rewriterule ^classified_payment_process$ classified_payment_process.php [L]
Rewriterule ^classified_payment_response$ classified_payment_response.php [L]
Rewriterule ^classifieds_json$ classifieds_json.php [L]
Rewriterule ^convert$ convert.php [L]
Rewriterule ^help$ help.php [L]
Rewriterule ^login_process$ login_process.php [L]
Rewriterule ^search_advanced$ search_advanced.php [L]
Rewriterule ^verification_image$ verification_image.php [L]
#search result
Rewriterule ^search/(.*)$ search_results.php?q=$1 [L]
#classified detail
Rewriterule ^classified/(.*)$ classified_details.php?id=$1 [L]
</IfModule>