Welcome! Log In Create A New Profile

Advanced

Redirecting a website in Ubuntu with Webdev App Server

Posted by Greg 
Hello All:

I installed Webdev Application Server in Ubuntu, and the application works when I use the following URL:

[mycompany.com]

Is there any way to redirect to /myproject when I use [mycompany.com] ?

Also, if I use multiple applications with different domains, it is still possible to redirect based on the domain?

Thanks
Greg
pao
Re: Redirecting a website in Ubuntu with Webdev App Server
July 11, 2025 12:43PM
In the default page of your domain normally index.htm or index.html you can redirect the user to your application.
Check the index.html generate by WEBDEV, adapt it and used it as the dewfault document of your domain.

Regards

Paulo Oliveira
Thank you Paulo.
I see there is an index.html file in /home/webdevuser/Sites/myproject but it already have the redirecting code. However, it is still not working.

Once thing I noticed is when I invoke [domain.com], apache2 screen is shown. I can only access my site when I use [domain.com]

Do you know what would be wrong?

Thanks
Greg
pao
Re: Redirecting a website in Ubuntu with Webdev App Server
July 11, 2025 05:59PM
Are you sure that your redirection code is in the default file used by your webserver?
normally it's the index.html in the /var/www/html

Regards

Paulo Oliveira
Thanks Paulo.
I was referring to the index.html file created by Webdev for each site.

I see you refer to the default index.html file for apache2 which is in /var/www/html directory. Now, even if I modify this file to redirect to another page, I'm looking to host several webdev sites, so I'm not sure how I can redirect to different websites depending on the domain in the request URL.

Any help would be much appreciated.

Regards;
Greg
pao
Re: Redirecting a website in Ubuntu with Webdev App Server
July 14, 2025 09:48AM
You can add some JS in the index.html file which is in /var/www/html to check the domain and proced to the app you need.

Something like:
if(location.hostname == "mysite.com"){

}

Regards

Paulo Oliveira
Re: Redirecting a website in Ubuntu with Webdev App Server
July 21, 2025 11:43AM
Hi Greg,

I'm not familiar with Linux, but in IIS you bind a site to an url.
So look for something similar in Ubuntu.

Best regards,
Piet
gga
Re: Redirecting a website in Ubuntu with Webdev App Server
November 14, 2025 07:01PM
Perhaps you could tell me where to download the linux version of HFSQL Server?
Thanks,
Garry
Re: Redirecting a website in Ubuntu with Webdev App Server
January 27, 2026 03:02AM
Adding JS in index file can hep you. Use syntax like this :

Something like:
if(location.hostname == "mysite.com"){

}

Tax Consulting in Dubai | Accounting and Bookkeeping Services in UAE | Best VAT Consultants in UAE | Internal Audit Services in UAE
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: