Directing subdomain to main domain and keeping the subdomain format with .htaccess


I am using bluehost and a single site wordpress site.

I want when someone types in to show the WordPress site at, but still use the subdomain address ( I have a piece of PHP in WordPress that recognizes the subdomain and delivers contact information based on that.

I have tried using this RewriteRule in my .htaccess file and while I feel a step closer, it is just giving new errors:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)$
RewriteRule ^(.*)$ [P]

When using wildcard redirects through bluehost, I get Bad Request and an additional 400 Bad Request error when trying to find the errordocument

Without using wildcard redirects, it does not seem to get to the point where the browser utilizes the .htaccess file in my directory.

What do I need to put into my .htaccess file to get this to work how I want it to?

, , Lisa 3 years 2019-10-27T23:57:41-05:00 0 Answers 73 views 0

Leave an answer