Apache redirection?

Reply

Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Apache redirection?

 
0
  #1
Mar 20th, 2004
How can I have all URLs under http://daniweb.com redirect to http://www.daniweb.com for SEO purposes?
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Apache redirection?

 
0
  #2
Mar 21st, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Apache redirection?

 
0
  #3
Mar 22nd, 2004
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?
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 282
Reputation: Roberdin will become famous soon enough Roberdin will become famous soon enough 
Solved Threads: 6
Team Colleague
Roberdin Roberdin is offline Offline
Supreme Evil Overlord

Re: Apache redirection?

 
0
  #4
Mar 22nd, 2004
And I thought you were the pc gal. You disappoint me Dani...

Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Apache redirection?

 
0
  #5
Mar 23rd, 2004
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:


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
Here it is for www.daniweb.com:


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
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 :)
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Apache redirection?

 
0
  #6
Mar 23rd, 2004
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
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Apache redirection?

 
0
  #7
Mar 23rd, 2004
Basically, dig is a DNS lookup utility. I just tried it again with the T_ANY switch, and here's the stdout:


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
This is for www.daniweb.com:


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

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...
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Apache redirection?

 
0
  #8
Mar 23rd, 2004
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
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Apache redirection?

 
0
  #9
Mar 23rd, 2004
Originally Posted by cscgal
My httpd.conf file does, indeed, have www.daniweb.com as a VirtualHost
Is it a VirtualHost or the ServerName? It actually does make a difference...
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Apache redirection?

 
0
  #10
Mar 23rd, 2004
Also, do you have mod_rewrite enabled/compiled?
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Linux Servers and Apache Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC