2

I am very noob and new to anything that deals with network issues. I have a problem that I have been researching but can't really find direct answers to. Bassically, my problem is the following

1) I am developing some web applications from my local MAMP server on my home machine.
2) I connect to the internet via a wireless CISCO Linksys E2500 router, as well as all my other devices

3) I would like it so that I can connect to my development machine without using its assigned IP address. I would like to create a domain for it, preferably just localhost, so that when I connect through my iphone I can see the development progress without constantly pushing changes to my server.

The reason I do not want to connect through the IP is because the page will not render correctly as all my loaded CSS, Javascript, Image files follow the localhost/developmentFolder/ directory, thus making the pages load incorrectly

I am developing some web applications that will have mobile versions and would like to test this as I work in my mobile browsers. Please let me know if there is a way for make any device in my local network connect through my machine through that specific domain name.

How would I go about doing something like this without any cost. Any help would be greatly appreciated.

2
  • 7
    If your assets (CSS, js, images, etc.) loading are dependant on the FQDN used to reach the page, you should REALLY reconsider how you're doing things. Maybe look into 'relative' vs. 'absolute' file paths (see related link) Commented Aug 8, 2013 at 18:40
  • The reason this is not possible is because I am always testing on various machines and using subversion so I cannot go into every line on ever different machine and change the code. I am also using codeigniter as my PHP framework so I have to set the base URLs accordingly
    – Dom
    Commented Aug 8, 2013 at 21:04

3 Answers 3

2

If you are looking to have network-wide, OS-independent naming on your LAN, then you should probably look at setting up a DNS server on your LAN, since what you're trying to do is what they're for. :)

Basically, you'll want to:

  • Find and install a DNS server of your liking.
  • Create a zone with the domain name of your choice.
  • Create an A Record in that zone wiht the host name you want to use and associate it with the development machine's IP.
  • Setup the DNS server to forward all unknown requests to external DNS (either your router, or the ISP's DNS servers, Google, etc.).
  • On you LAN devices, enter your new DNS server as their DNS server in their IP settings.
  • Profit.

You should avoid trying to use "Localhost" as a host name, since it's (usually) reserved for the local loopback (127.0.0.1).

Keep in mind this is only for dealing with what you asked for -- being able to reach a device on the LAN by name. It doesn't take into account people coming in from the Internet. :)

0

The easiest by far is going to be to Port Forward TCP 80 on the router to the LAMP box. Keep in mind that the whole world can now see your web server, so security shouldn't be ignored. "localhost" is a reserved name, so you can't use that. Grab a free subdomain from NoIP, Afraid, or anyone else providing it. Point that subdomain at your IP (you can figure it out by going to http://whatsmyip.org) and Bob's your uncle.

0

Use the forward port 80. On the external IP to be on your device to the internal MAMP server.

If the Apache server will generate work with the visitor by using RewriteRule and RewriteCond, you will be able to bridge the self with any of their projects.

Apache mod_rewrite Technical Details

Apache .htaccess RewriteRule RewriteCond:

Apache .htaccess RewriteRule RewriteCond

Apparently, you're doing something wrong. It is important to have a web part - scripts, html, css does not depend on the name. It ought to matter what you use any domain or IP address. It is also desirable to have an independent path. This is when the directory tree can be changed or has some virtual trees. This is very useful for people with different logic when they use the path on the website to navigate through it. Or interaction with other sites. Or when the site has a lot of ideas.

In general, if the site is after the change of the domain name, parts of the path, all paths, is an indicator of a certain quality.

Simple and clear the path names is one method of navigation.

Also, the rules make it possible to transform ways to use short aliases.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .