Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issue with relative urls

Featured Replies

Hi,

 

I've installed Uniform Server from scratch, however there is an issue.

 

I can't use links such as these => href="/favicon.ico"

 

It doesn't work, it doesn't add the file, I am forced to do something like this instead => href="../favicon.ico" depending on the number of folders that separate the two files.

 

I assume that's a setting, but I've never had to change that setting before, it always worked by default, and this problem is absolutely ungooglable.

 

Anyone knows how to fix it?

  • Author

Ah I've found the issue, the root path was not there I thought it was. Is there a way to delete this thread?

Is there a way to delete this thread?

 

Any admin can delete a thread however you raised an issue and more importantly found a solution. This benefits other uses with the same or similar problem hence no reason to delete this thread.

 

All the best

Ric

  • Author

In this case I'll give a more detailed explanation.

 

My root directory was the following :

C:/UniServer/www

 

In this directory, I have different directories for different projects :

 

C:/UniServer/www/project1

C:/UniServer/www/project2

 

A link such as 'href="/favicon.ico"' will go look at the root of the Apache folder, which is typically www, in contrary to a PHP url which considers "/favicon.ico" to be in the folder where the first PHP page was called for the request.

 

Solution 1

 

Use the following href link = 'href="/project1/favicon.ico' instead of 'href="/favicon.ico"'

 

Solution 2

 

Find your httpd.conf file in your Apache directory, modify this line :

 

<Directory "C:/UniServer/www">

 

To this :

 

<Directory "C:/UniServer/www/project1/">

 

Then restart Apache

 

However, note that this means your other projects in the www folder will not be accessible anymore as they will be outside Apache.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.