১. redirect.sh তৈরি করুন
SSH থেকে project directory-তে গিয়ে একবার এই command চালান:
echo '#!/bin/bash
DOMAIN="$1"
if [ -z "$DOMAIN" ]; then
echo "Usage: ./redirect.sh example.com"
exit 1
fi
mv .htaccess ".htaccess.bak.$(date +%Y%m%d-%H%M%S)"
cat > .htaccess <<EOF
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
RewriteRule ^(.*)$ https://$DOMAIN/\$1 [R=301,L]
</IfModule>
EOF
echo "Redirect: https://$DOMAIN/"
' > redirect.sh && chmod +x redirect.sh২. Redirect সেট করুন
এরপর শুধু domain parameter দিন:
./redirect.sh example.comঅথবা:
./redirect.sh noman-it.com