Page 1 of 2

SOLVED: WebCalendar only using short name URLs

Posted: Fri Jun 29, 2012 11:26 am
by raifwrite
After installing WebCalendar I cannot access most features as the behavior is for the program to default to webcalendar/"anypage".php instead of webcalendar.mydomain.com/"anypage".php. Since I have my router handling DHCP due to some issues with AES recognizing wireless devices, I only have Amahi running as a DNS.

As a result, it cannot resolve the shortnames WebCalendar is trying to use. Even if I input the full domain name to access a page in WebCalendar, as soon as I click on an internal link it tries to navigate using the short form url again. Is there a way to change WebCalendar's default behavior so it only uses the long form domain url?

Re: WebCalendar only using short name URLs

Posted: Fri Jun 29, 2012 11:29 am
by bigfoot65
I am sure there probably is, but you will need to check out the code. You might consider checking their web site for forums. Might find help there.

Re: WebCalendar only using short name URLs

Posted: Fri Jun 29, 2012 11:52 am
by raifwrite
Will do. I'll check back if I make any progress

Re: WebCalendar only using short name URLs

Posted: Fri Jun 29, 2012 12:04 pm
by bigfoot65
Thanks. I am sure it's something simple, but knowing where to look is the problem :)

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 9:29 am
by rdagijones
I am having this same problem. Right now if I put in "webcalendar/" as the url it does not resolve correctly to the application. If I put in "webcalendar.home.com/" the web page resolves to the WebCalendar login screen. When I put in the user name and password the next page that tries to come up is "webcalendar/month.php", which fails to load. I then edit the url to be "webcalendar.home.com/month.php" and I can see the month layout in WebCalendar. From then on, some pages resolve correctly and others do not. For example, I can go to the page to add a new user, but when I attempt to save that new users settings it fails. I have two hda's in the building and have to use long urls to get apps to work.

I contacted WebCalendar's forum and got the following:
All I can tell you is that when webcalendar is going to "webcalendar/month.php", he's actually doing a redirect. In index.php, he finds 'month.php' as your default page, then calls function do_redirect, passing 'month.php' as the URL. Function do_redirect prepends the URL passed by your webserver to the URL passed from index.php. So he should be redirecting to "webcalendar.home.com/month.php", but for some reason is not getting the "webcalendar.home.com/" from your webserver. He apparently is only getting "webcalendar/". You might discuss this with your network and/or web administrator to find out why.
Here's what I am wondering: Could an .htaccess file get around this problem?

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 10:06 am
by bigfoot65
Try changing the SERVER_URL value in the database webcalendar, table webcal_config. It is currently set to http://webcalendar/ and removing the tailing slash might do the trick.

If not, will have to consider another option, like maybe adding the domain, http://webcalendar.home.com/.

Once of these two solutions should fix the problem. We can modify the app to do this automatically if it works. The .htaccess is another option, but we can explore that if one of these don't work.

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 1:16 pm
by rdagijones
Tried changing the SERVER_URL value in the database webcalendar, table webcal_config from http://webcalendar/ to http://webcalendar.home.com/ (with and without the trailing "/" and no success. WebCalendar still tries to resolve each page to the short url. Attempting to add users fails due to invalid url problems.

How would I add the domain? I tried adding an alias under "Webapps" > webcalendar and that did nothing to solve the issue.

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 1:27 pm
by bigfoot65
May need to look for other places in the app dir where the URL might be set. I will see what I can find.

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 1:31 pm
by bigfoot65
One other note. If you are not using the HDA for DHCP server, see the link below for what will not work.
https://www.amahi.org/faq#is-dhcp-server-required

This appears to be part of your problem.

Re: WebCalendar only using short name URLs

Posted: Tue Jun 18, 2013 1:39 pm
by bigfoot65
I just tried changing the URL to http://webcalendar.home.com/ in the app and it appears to be working correctly from what I can tell.

Maybe it needs to be changed that way vs the database directly. The domain would be whatever you are using for your hda, so not necessarily home.com.