Welcome, Guest. Please login or register.
April 30, 2024, 09:18:43 AM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: Website and DNS issues 0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: Website and DNS issues  (Read 2424 times)
IainC
Developers
Posts: 6538

Wargaming.net


WWW
on: July 24, 2012, 07:32:11 AM

I am building a website for a friend, it's nothing fancy just using Wordpress as a CMS on a super cheap hosting plan.

She has three websites, each of which is a separate Wordpress install into its own subdirectory so she has domain.de/directory1, domain.de/directory2 etc.

There are two problems that I'm facing. The first is that domain.de will resolve to her site but www.domain.de does not.

The second is that I gave one of the subdirectories a capital letter (domain.de/Directory) and domain.de/directory will not resolve to that site either - and vice-versa in the case of the other sites.

How can I fix this? I have limited access to the server which is running Apache 2.4.2 if that's important.

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
Lantyssa
Terracotta Army
Posts: 20848


Reply #1 on: July 24, 2012, 08:01:09 AM

I am building a website for a friend, it's nothing fancy just using Wordpress as a CMS on a super cheap hosting plan.

She has three websites, each of which is a separate Wordpress install into its own subdirectory so she has domain.de/directory1, domain.de/directory2 etc.

There are two problems that I'm facing. The first is that domain.de will resolve to her site but www.domain.de does not.

The second is that I gave one of the subdirectories a capital letter (domain.de/Directory) and domain.de/directory will not resolve to that site either - and vice-versa in the case of the other sites.

How can I fix this? I have limited access to the server which is running Apache 2.4.2 if that's important.
(I am assuming this is on a hosted site.  We may need more details.)

The www.domain.de needs to be added as an alias to the DNS server.  There may be options in the host's control panel.  Ask tech support if nothing stands out.

The second is probably a Unix capitalization issue.  'Directory' and 'directory' are different paths.  Apache might have an option to ignore case, but otherwise you'll need to make some kind of forwarding link.  I'll try and research it if I have some time since it'll be good to know.

Hahahaha!  I'm really good at this!
IainC
Developers
Posts: 6538

Wargaming.net


WWW
Reply #2 on: July 24, 2012, 08:30:38 AM

It is on a hosted server (hosted at gandi.net). Doing some digging it appears that I need to edit the zone file (the domain is also registered with Gandi.net).

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
kildorn
Terracotta Army
Posts: 5014


Reply #3 on: July 24, 2012, 08:37:51 AM

You need rewrite rules for directory cases.

Personally, I'd change the site to use lowercase, because it makes life a lot easier in the long run to make a rewrite that just lcases the whole request, instead of trying to parse out and selectively uppercase characters.

The issue is less Apache, and more that the underlying filesystem is case sensitive, so /var/www/Directory/ and /var/www/directory/ are completely different locations.

If you have direct access to the zone file, you just need to add a www entry. We can probably help you out there if you need.

edit: if you insist on using upper case in the URI though, I'd suggest hiding it behind a default index so only your code ever references the upper cased characters. Messes with people typing in the address, but they shouldn't be hand deep linking anyways, it's barbaric!
« Last Edit: July 24, 2012, 08:41:19 AM by kildorn »
IainC
Developers
Posts: 6538

Wargaming.net


WWW
Reply #4 on: July 24, 2012, 08:47:13 AM

Ok, so I think I fixed the www issue with the zone file, I just need to wait for it to propagate so that I can test it.

The problem with the subdirectory is that it's the main address that will be on business cards and flyers etc so people will need to type it in. She has three different websites which are each in their own subdirectory so /Business, /business2 and /business3. One of the three (before I realised that wit was a bad idea) has a capital letter, the others are all lowercase. I'd like to avoid having to delete the directory and start again if possible as there's a fair bit of internal references from other sites that would need to be fixed however having domain.de/business not resolve to her website is a big problem that I need to fix.

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
kildorn
Terracotta Army
Posts: 5014


Reply #5 on: July 24, 2012, 08:53:58 AM

You can hack it for one directory with an Alias directive in apache:

Alias /directory /filesystem/path/to/Directory

It's hackish and doesn't fix it as well as a rewrite rule (which actually changes the URL the client sees), but solves the one odd directory issue.

For the DNS, if you hand edited the zone file, I hope you remembered to up the sequence number so it actually propagates!
Lantyssa
Terracotta Army
Posts: 20848


Reply #6 on: July 24, 2012, 08:56:37 AM

Are the cards already made?  If not, in the zone file I'd add three new entries:  site1.domain.de, site2.domain.de, and site3.domain.de which point to the proper paths.

Have the (www.)domain.de be a landing page with links to those three.  Further, redo the file structure so it is all lower case.  Then follow these step to change all URIs to lowercase.  Then it doesn't matter if they use /directory, /Directory, /DIRECTORY, or any combination of upper and lower.  They'll all go to /directory.

Hahahaha!  I'm really good at this!
IainC
Developers
Posts: 6538

Wargaming.net


WWW
Reply #7 on: July 24, 2012, 08:58:35 AM

Where do I do the alias directive?

I don't know about the sequence number. I copied the original zone file, changed the copy to add a new A record, made it active and then deleted the old one. This was all via a web interface so I don't know what else was going on in the background.

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
IainC
Developers
Posts: 6538

Wargaming.net


WWW
Reply #8 on: July 24, 2012, 09:05:29 AM

Ok, so if I understand your link correctly Lant, it looks as though I have no real choice except to recreate the directory with a capital letter, then use the 301 redirect in the htaccess file to make sure that it doesn't matter what anyone types?

The cards are already made so converting the subdirectories to subdomains (or faking it via the zone file) isn't an option.

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
Hammond
Terracotta Army
Posts: 637


Reply #9 on: July 24, 2012, 09:07:27 AM

Just sounds like it was something in the dns record that was incorrect as far as the www.domain.de not resolving.  Like you need to add a A record or a cname (whatever your preference) for the www.domaine.de to direct to the ip.

You can use a 3rd party website like http://network-tools.com/ to check to see if the dns records are being recognized outside your ISP's dns servers. Or you can get fancy and use nslookup, dig or Network utility to query googles dns servers.

As far as the capitol letter goes yea you want to change that.  Linux sees them as separate characters and it can create some serious issues. If you have shell access to the sites you can just do a simple find and replace across all the files.  Or you can download them and use a windows tool like http://findandreplace.sourceforge.net/ to search all of the files and fix them.  Although since it is a wordpress site you may have to download the sql file to fix that way. 


Funny story, back in the day windows didn't care if you did uppercase or lowercase characters it saw them as the same.  So I had the pleasure of helping a customer that made a website in Frontpage (think Microsoft Word except to make websites) to move the site to a linux server.  Lets just say frontpage extensions and linux are bad enough.  But throw in both files with uppercase / lowercase and the customer changing them around and finding out when you upload File.jpg it does not overwrite file.jpg was just a joy.
Hammond
Terracotta Army
Posts: 637


Reply #10 on: July 24, 2012, 09:21:08 AM

Where do I do the alias directive?

I don't know about the sequence number. I copied the original zone file, changed the copy to add a new A record, made it active and then deleted the old one. This was all via a web interface so I don't know what else was going on in the background.

Is the interface cpanel?  Typically the web interfaced ones automatically do the sequencing for you in the backend.  Keep in mind if the TTL (time to live) is really high it may not resolve for a bit until it propagates out.  You can also query the dns server for the website directly with nslookup.  If you do not know the dns server name you can look it up through the http://network-tools.com/ website.
IainC
Developers
Posts: 6538

Wargaming.net


WWW
Reply #11 on: July 24, 2012, 09:36:39 AM

Awesome. I created an .htaccess file and used a redirect to switch people from /hilfe to /Hilfe and that all works now. Thanks a lot for your help guys.

- And in stranger Iains, even Death may die -

SerialForeigner Photography.
Lantyssa
Terracotta Army
Posts: 20848


Reply #12 on: July 24, 2012, 10:05:20 AM

Welcome to the wonderful world of web development!

I still think you should make the physical directory all lower case and redirect anything else to that, but if it works for you go with it.

Hahahaha!  I'm really good at this!
Hammond
Terracotta Army
Posts: 637


Reply #13 on: July 24, 2012, 10:10:37 AM



I still think you should make the physical directory all lower case and redirect anything else to that, but if it works for you go with it.

Me to, seriously if you have time fix it right.  If you have to come back and troubleshoot this or even worse someone else down the road does it will save everyone time. 
Salamok
Terracotta Army
Posts: 2803


Reply #14 on: July 24, 2012, 10:23:05 AM

Ok, so if I understand your link correctly Lant, it looks as though I have no real choice except to recreate the directory with a capital letter, then use the 301 redirect in the htaccess file to make sure that it doesn't matter what anyone types?

The cards are already made so converting the subdirectories to subdomains (or faking it via the zone file) isn't an option.
Alternatively you can include some dynamic script in your 404 page that lower cases the address and redirects to that.  If you don't understand mod_rewrite and mod_rewrite rules this may be your simplest solution.

Although mod_speling looks pretty slick too.
Hawkbit
Terracotta Army
Posts: 5531

Like a Klansman in the ghetto.


Reply #15 on: November 16, 2012, 11:42:04 AM

Wasn't really sure where to put this, but anyways.  I started playing around with the web debugging tool Fiddler2 at work, looking at traffic.  What a damned awesome tool. 

http://www.fiddler2.com/fiddler2/version.asp

For giggles, I went to IGN to see the request/response results and OMG, 100+ responses.  I'm new to the seedy underbelly of HTTP structure, but now that I'm looking and learning, my head is asploding at the sheer amount of information that was just unlocked to me. 
Ingmar
Terracotta Army
Posts: 19280

Auto Assault Affectionado


Reply #16 on: November 16, 2012, 11:45:05 AM

Wow that's a bad choice of name.

The Transcendent One: AH... THE ROGUE CONSTRUCT.
Nordom: Sense of closure: imminent.
Miasma
Terracotta Army
Posts: 5283

Stopgap Measure


Reply #17 on: November 18, 2012, 05:32:02 AM

There's a messed up link in the news box at the bottom.
Zetor
Terracotta Army
Posts: 3269


WWW
Reply #18 on: November 18, 2012, 07:12:59 AM

Fiddler2 is ok if you are debugging an ASP/.NET site (since it has pretty good viewstate functionality, etc) and are using IE, but I recommend Burpsuite for srs bsns work, especially for sites that use SSL.

(yes, 'unfortunate names' are a trend in the haxx0r business  awesome, for real)

Hawkbit
Terracotta Army
Posts: 5531

Like a Klansman in the ghetto.


Reply #19 on: November 18, 2012, 10:37:30 AM

Thanks for the link.  I'll have to check it out sometime, but the $300 price tag is a bit over this student budget.  ;)  The tool looks slick though.
Pages: [1] Go Up Print 
f13.net  |  f13.net General Forums  |  General Discussion  |  Topic: Website and DNS issues  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC