dns redirect question

Problems with the Windows version of XAMPP, questions, comments, and anything related.

dns redirect question

Postby stevek » 17. January 2011 10:27

Hello,

I am having a small issue that I cannot seem to resolve myself. It is possible that his has nothing to do with xampp but I'm not sure so I turn here for advise.

For an event I am going to setup a local Wifi hotspot with a captive portal. To do this I have a pc with dnsredirector on and I have a Wifi router that has a fixed dns IP that is the IP of the pc with dnsredirector.

On the "dns" pc I have xampp running with the pages that I want the users who connect to the network to see.

When I test this, this works but only if I type a url that is = *.com or any other url extension but it does not work when i.e. someone has google.com/page.php as a home page. When I remove the /page.php it redirects fine.

The question here is if this is something I can adjust in xampp by doing some sort of url replacement or a .htaccess that redirect any incoming page request?

If this is not xampp related, I apologize. Thanks in advance for any response on this.
stevek
 
Posts: 4
Joined: 17. January 2011 09:34

Re: dns redirect question

Postby Sharley » 17. January 2011 11:34

stevek wrote:The question here is if this is something I can adjust in xampp by doing some sort of url replacement or a .htaccess that redirect any incoming page request?
If I understand your question correctly the answer may lie in using and understanding mod_rewrite which 'provides a rule-based rewriting engine to rewrite requested URLs on the fly'.

mod-rewrite is enabled by default in XAMPP.

This can be used in .htaccess files and a working knowledge of regex (regular expression) will be a great advantage.

This is not an easy subject and would require much reading and researching to get a handle on the subject to allow you to write the rules you require - but there are many good working examples on the Internet and Google will be your best friend finding them.

Here are a few links that may get you off to a start:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
http://www.askapache.com/htaccess/crazy ... orial.html
http://www.askapache.com/htaccess/mod_r ... sheet.html
http://corz.org/serv/tricks/htaccess2.php?page=3

There is even a dedicated forum:
http://forum.modrewrite.com/viewtopic.php?t=1445

Regex tutorial, one of many:
http://gnosis.cx/publish/programming/re ... sions.html
Commercial Apps like Regex Buddy and Regex Magic may help by using a GUI to work thinks out.

I hope the above will not be too daunting for you.

Good luck and best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: dns redirect question

Postby stevek » 17. January 2011 11:43

Thank you for the quick response.

This would mean that you agree that this could be handled by xampp, provided I use the correct actions/rules.

I am going to take a look at the links you provided and see how far I get. Otherwise I will inform people that they have to type in some generic url that has the correct syntax to enable the redirect which would also resolve my issue but would require additional actions from the users and does not look so neat off course :D .
stevek
 
Posts: 4
Joined: 17. January 2011 09:34

Re: dns redirect question

Postby Sharley » 17. January 2011 11:55

stevek wrote:This would mean that you agree that this could be handled by xampp, provided I use the correct actions/rules.
Yes, I believe Apache can handle what you require.

If you are looking for pretty URLs then here are a couple of tutorials for mod-rewrite that may help.
http://www.roscripts.com/Pretty_URLs_-_ ... g-168.html
http://net.tutsplus.com/tutorials/other ... etty-urls/


Sorry for keep piling reading on you but it is required if you want to learn about this very handy Apache module.

Best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: dns redirect question

Postby stevek » 17. January 2011 13:36

No problem, the more info the better.

I have had some minor success already. I was able to get the redirect working for any incoming uri but now I'm stuck as I am unable to navigate in the redirected pages.

What happens I believe is that any and all requests get redirected to the default, so I would need some exception built in. Complicated material for sure :D

Thanks again for the help.
stevek
 
Posts: 4
Joined: 17. January 2011 09:34


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 51 guests