Forum Moderators: coopster

Message Too Old, No Replies

ssl certificates and checking domain access

         

jackvull

10:39 am on Mar 4, 2006 (gmt 0)

10+ Year Member



Hi
I have a SSL certificate for my domain www.#*$!xx.net

Unfortunately, it is not a wildcard certificate and will not work for browser access to xxxxx.net

Is there a way in PHP to check the browser address and if a user types in xxxxx.net, I can forward them to www.xxxxx.net?

Thanks

coopster

5:39 pm on Mar 4, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, but it's probably much easier to do in Apache, and likely faster. With PHP you could check the $_SERVER['SERVER_NAME'].

jackvull

9:44 am on Mar 9, 2006 (gmt 0)

10+ Year Member



So, could it be done with a .htaccess file?

omoutop

10:12 am on Mar 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



with htaccess and permanent redirection yeah you could do this....

one simple way is :

RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ [mysite.com...] [R=permanent,L]

coopster

8:29 pm on Mar 9, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Or just use a redirect [httpd.apache.org].