create subdomian

hi

I don’t have any subdomain

but I want to redirect addresses

from *.example.com to www.example.com

please help me

htaccess?

urlmanager?

create subdomian Phisically?

Use a .htaccess file. Something like this will redirect any URL that doesn’t start with www to www.your-domain.com.

Recreated below for posterity:




RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.

RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]



You should probably test with a 302 redirect to make sure it works how you want it to before using the 301.

If you need this to work for subdomains that don’t exist, you’ll need to set up a wildcard DNS record pointing to your server.

thanx Keith

domain exists but subdomians don’t exist

DO i need setup a wildcard?

:unsure:

You’ll need a wildcard in the DNS and you’ll need to do configure the web server too. Here’s a guide for cpanel if your server has that installed.