| | |
Apache redirection?
![]() |
How can I have all URLs under http://daniweb.com redirect to http://www.daniweb.com for SEO purposes?
You could either use a redirector script (not the best way to do it) or you could make sure your httpd.conf has www.daniweb.com as the ServerName instead of just daniweb.com (if you have control over your server.) My guess is that your httpd.conf has just daniweb.com, but since I don't know too much about your configuration, I'm just guessing there :)
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
My httpd.conf file does, indeed, have www.daniweb.com as a VirtualHost
I tried adding daniweb.com as well, and that just completely failed - every access to the page was running in circle doing infinite redirects between the two VirtualHosts.
I am pretty sure what I want can be done with .htaccess though. Could someone give me a heads up about that?
I tried adding daniweb.com as well, and that just completely failed - every access to the page was running in circle doing infinite redirects between the two VirtualHosts.
I am pretty sure what I want can be done with .htaccess though. Could someone give me a heads up about that?
•
•
Join Date: Feb 2003
Posts: 282
Reputation:
Solved Threads: 6
And I thought you were the pc gal. You disappoint me Dani...
Personally, I don't use .htaccess if I can do it in httpd.conf. Even the folks over at Apache suggest that. But I digress...
I just did a "dig" on both domains, and found some differences in the results (which should be the same, since they're both on the same box, same server, etc.)
Here's the stdout of daniweb.com:
I just did a "dig" on both domains, and found some differences in the results (which should be the same, since they're both on the same box, same server, etc.)
Here's the stdout of daniweb.com:
Here it is for www.daniweb.com:
kevin@Cerberus$ dig http://daniweb.com
; <<>> DiG 8.3 <<>> http://daniweb.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUERY SECTION:
;; http://daniweb.com, type = A, class = IN
;; AUTHORITY SECTION:
com. 1h26m24s IN SOA a.gtld-servers.net. nstld.verisign-grs.com. (
1080019309 ; serial
30M ; refresh
15M ; retry
1W ; expiry
15M ) ; minimum
;; Total query time: 18 msec
;; FROM: Cerberus.geekis-kahn.net to SERVER: default -- 167.206.3.166
;; WHEN: Tue Mar 23 13:18:19 2004
;; MSG SIZE sent: 36 rcvd: 109
It doesn't matter how many times I redo it, I always get the same results for both. The DNS servers for www.daniweb.com are different than for daniweb.com, along with the settings for expiry, etc. I don't know that that's the answer you're looking for, but it's a start, at least. I'll do some further checking later today after I get back from a service call and let you know if I can *dig* up any more info :)
kevin@Cerberus$ dig http://www.daniweb.com
; <<>> DiG 8.3 <<>> http://www.daniweb.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUERY SECTION:
;; http://www.daniweb.com, type = A, class = IN
;; AUTHORITY SECTION:
daniweb.com. 1h25m33s IN SOA ns.propagation.net. hostmaster.propagation.net. (
2003103121 ; serial
1D ; refresh
2H ; retry
5w6d16h ; expiry
8H ) ; minimum
;; Total query time: 19 msec
;; FROM: Cerberus.geekis-kahn.net to SERVER: default -- 167.206.3.166
;; WHEN: Tue Mar 23 13:19:42 2004
;; MSG SIZE sent: 40 rcvd: 105
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
My httpd.conf file ony has an entry for www.daniweb.com ... :/ Is this "dig" a result of Network Solutions / Verisign as my registrar, or my host? I'm on a dedicated server. But I'm confused now
Basically, dig is a DNS lookup utility. I just tried it again with the T_ANY switch, and here's the stdout:
This is for www.daniweb.com:
kevin@Cerberus$ dig T_ANY daniweb.com
; <<>> DiG 8.3 <<>> T_ANY daniweb.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 2
;; QUERY SECTION:
;; daniweb.com, type = A, class = IN
;; ANSWER SECTION:
daniweb.com. 4H IN A 69.13.146.64
;; AUTHORITY SECTION:
daniweb.com. 4H IN NS ns2.propagation.net.
daniweb.com. 4H IN NS ns3.propagation.net.
daniweb.com. 4H IN NS ns4.propagation.net.
daniweb.com. 4H IN NS ns.propagation.net.
daniweb.com. 4H IN NS ns1.lax.propagation.net.
daniweb.com. 4H IN NS ns2.lax.propagation.net.
;; ADDITIONAL SECTION:
ns2.lax.propagation.net. 3h27m28s IN A 66.34.193.2
ns4.propagation.net. 1h23m21s IN A 63.249.128.203
;; Total query time: 72 msec
;; FROM: Cerberus.geekis-kahn.net to SERVER: default -- 167.206.3.166
;; WHEN: Tue Mar 23 13:42:18 2004
;; MSG SIZE sent: 29 rcvd: 203
The DNS servers appear to be the same for both domains on this search. Let me do some more *cough* digging *cough* and I'll let you know...
kevin@Cerberus$ dig T_ANY www.daniweb.com
; <<>> DiG 8.3 <<>> T_ANY www.daniweb.com
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 3
;; QUERY SECTION:
;; www.daniweb.com, type = A, class = IN
;; ANSWER SECTION:
www.daniweb.com. 4H IN A 69.13.146.64
;; AUTHORITY SECTION:
daniweb.com. 4H IN NS ns1.lax.propagation.net.
daniweb.com. 4H IN NS ns2.lax.propagation.net.
daniweb.com. 4H IN NS ns2.propagation.net.
daniweb.com. 4H IN NS ns3.propagation.net.
daniweb.com. 4H IN NS ns4.propagation.net.
daniweb.com. 4H IN NS ns.propagation.net.
;; ADDITIONAL SECTION:
ns1.lax.propagation.net. 3h49m27s IN A 66.34.193.1
ns2.lax.propagation.net. 3h12m42s IN A 66.34.193.2
ns4.propagation.net. 1h8m35s IN A 63.249.128.203
;; Total query time: 96 msec
;; FROM: Cerberus.geekis-kahn.net to SERVER: default -- 167.206.3.166
;; WHEN: Tue Mar 23 13:57:04 2004
;; MSG SIZE sent: 33 rcvd: 223
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
OK Cool thanks. propagation.net is my webhost where I have a dedicated server. (Well, duh, that info was obvious already). But, yeah, either in .htaccess or via httpd.conf I'd like to have daniweb.com redirect to www.daniweb.com
•
•
•
•
Originally Posted by cscgal
My httpd.conf file does, indeed, have www.daniweb.com as a VirtualHost
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
![]() |
Other Threads in the Linux Servers and Apache Forum
- Previous Thread: please help a newbie out with apache
- Next Thread: no website configured at this adress
| Thread Tools | Search this Thread |
.net apache apple 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 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







