سمّ هذا الملف .htaccess وضعه في الدليل الجذر للنطاق الذي تريد إعادة التوجيه منه.
استبدل my-new-domain.com بالنطاق الذي تريد إعادة التوجيه إليه. (تذكر في سطر RewriteCond، الـ . في النطاق تحتاج تهريبًا بشرطة مائلة عكسية!)
.htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-new-domain\.com$ [NC]
RewriteRule ^(.*)$ https://my-new-domain.com/$1 [L,R=301]
Check out similar posts by category:
خادم الويب
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow