| | |
Force WWW except for Subdomains Issue
Thread Solved
![]() |
I've been looking over the same .htaccess codes that will not work for a subdomain. It seems not many people really know how to do a correct .htaccess (including me I suppose). I've tried:
And it requires the WWW on the subdomain, such as bob.site.net, which I do not want. Does anyone have a solution to my problem?
RewriteCond %{HTTP_HOST} !^site\.net$ [NC]
RewriteRule ^(.*)$ http://site.net/$1 [R=301,L]And it requires the WWW on the subdomain, such as bob.site.net, which I do not want. Does anyone have a solution to my problem?
So, basically starting off reading your rule, it says:
If someone accesses this site that is *NOT* from http://site.net
Then redirect them to http://site.net/string
Maybe removing the 'NOT' is what your looking for:
Which would state, if someone is accessing your site from site.net redirect to www.site.net/string
This rule would activate for anyone hitting http://site.net but not http://bob.site.net
Is this the goal?
If someone accesses this site that is *NOT* from http://site.net
Then redirect them to http://site.net/string
Maybe removing the 'NOT' is what your looking for:
RewriteCond %{HTTP_HOST} ^site\.net$ [NC]
RewriteRule ^(.*)$ http://www.site.net/$1 [R=301,L]Which would state, if someone is accessing your site from site.net redirect to www.site.net/string
This rule would activate for anyone hitting http://site.net but not http://bob.site.net
Is this the goal?
--
<Something clever here>
RHCDS/MCP/DCSP
<Something clever here>

RHCDS/MCP/DCSP
![]() |
Similar Threads
- .htaccess - remove www. except when https (Linux Servers and Apache)
- Subdomains?? what can I do ?? (Search Engine Optimization)
- DTS Package (C#)
- help pls.. database related! (VB.NET)
- What exactly is xml? (RSS, Web Services and SOAP)
- Go to a certain page when button is pressed and do it securely (ASP.NET)
- Computer Shut Down Problems (Viruses, Spyware and other Nasties)
- aspx page and sql: together at last (hopefully) (ASP.NET)
- I need to trace or view that the stored proc is saving the data. (VB.NET)
Other Threads in the Linux Servers and Apache Forum
- Previous Thread: local host problem
- Next Thread: Fedora's All Spins Zone
| Thread Tools | Search this Thread |
.net apache asus bbc bluegene centos cisco citrix cloud cloudcomputing datacenters debian dell desktops development distributions distros drivers economy eeepc energy enterprise fedora gadgets gentoo gos government gpl hardware hp hyper-v ibm java jobs kindle knoppix kvm laptop laptops lawsuits licensing limo linustorvalds linux linuxfoundation linuxmagazine magazines microserver microsoft mobile mobilephones motorola netbook netbooks news novell olpc open openmoko openoffice opensolaris opensource opensuse openvz operatingsystems os patents pc pcworld plathome politics print qumranet redhat rhel robot russia sco server servers slackware software solaris source sun supercomputer support tivo torvalds training tv ubuntu umpc unix virtualization vmware windows x86 xandros xen





