Jump to content

redirect subdomain to a php file


mostafa.fayyaz

Recommended Posts

You'll need to use your .htaccess like this..

RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com
RewriteRule ^(.*)$ http://example.com/show.php?url=test [R]

If you want... test4.example.com to = show.php?url=test4..

RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com
RewriteRule ^(.*)$ http://example.com/subdomain$1 [R]

 

You'll need to use your .htaccess like this..

RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com
RewriteRule ^(.*)$ http://example.com/show.php?url=test [R]

If you want... test4.example.com to = show.php?url=test4..

RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain\.example\.com
RewriteRule ^(.*)$ http://example.com/subdomain$1 [R]

 

i used this code , but doesn't work .

Server not found

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.