Rewrite domain url for php script with .htaccess - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Tuesday, March 22, 2022

Rewrite domain url for php script with .htaccess

php or js script works correctly only on domain1.com

Can I fool them with .htaccess to think I use domain1.com while actually having domain2.com in url? That is having $_SERVER['SERVER_NAME']; return domain2.com

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(?:www\.)?domain2.com$ [NC]
RewriteRule ^ http://domain1.com%{REQUEST_URI}

These instructions aren't quite working.



source https://stackoverflow.com/questions/71562362/rewrite-domain-url-for-php-script-with-htaccess

No comments:

Post a Comment