I am using Light server, and I have to redirect demands like:
world wide web.world wide web.example.com to world wide web.example.com along with other versions like (wwww.example.com, etc)
I understand I'm able to get it done inshtaccess, but I'm not sure the standard expression which i should use to represent each one of these options.
Or there's any diferent approach, comming in the vhosts?
# pressure world wide web IN URL RewriteEngine on RewriteCond % !^www.example.com [NC] RewriteRule ^(.*)$ http://world wide web.example.com/$1 [R=301,L] # Finish pressure world wide web IN URL
Essentially anything that's not world wide web.example.com can get redirect 301'd.
Check this out article for applying "wildcard subdomains." You are gonna need to implement both an .htaccess and modifying the Vhosts.
If you are thinking about only restricting it to "world wide web.world wide web," "wwww.," and also the other good examples above, it is simple to achieve this with a few server-side coding (which causes it to be more flexible than applying more .htaccess code). Just identify exactly what the subdomain is, and redirect in which you want.
Using title based virtual hosts in Apache this can be done:
<VirtualHost *:80> ServerName example.com ServerAlias wwww.example.com world wide web.world wide web.example.com [space seperated list] Redirect / http://world wide web.example.com/ </VirtualHost>
Redirect may take a parameter to specify the kind of redirect.