Relative URLs Not Working Correctly in Subdirectory WordPress Setup on OpenLiteSpeed

#1
Hi,

I have an AWS EC2 instance with OpenLiteSpeed WordPress installed in the default directory /var/www/html. I created a new folder inside this directory (/var/www/our-world) and installed a new WordPress setup there. I am running this second WordPress site with the domain binding https://www.example.com/our-world.

With this setup, my relative URLs are not working correctly. Instead of prepending the complete URL as https://www.example.com/our-world, it is only prepending the main domain https://www.example.com. For example, I have an anchor element with the relative path '/dummy'. I expect it to auto-prepend the site URL and result in a complete URL like: https://www.example.com/our-world/dummy. However, it is giving the complete URL as https://www.example.com/dummy.

I checked the WordPress settings, and both the WordPress URL and Site URL are set to https://www.example.com/our-world. I also tried modifying the rewrite rules in the .htaccess file without any luck.

Can anyone please suggest which configuration I might be missing? Any help is much appreciated.

Thanks!
 
#3
Hi,

It's already created. Please look into the attachment below.

However, It's not a problem when I manually type the complete URL to the search bar, page opens without ant issue. But it's an issue when one anchor element having href set with relative path, only main domain is getting prepended instead complete domain+subdirectory(our-world).

Thanks

1716344854000.png
 
#5
Hi,

This is one of the anchor tag which shows how I'm adding the href in my HTML Code.

HTML:
<a href="/about/our-journey/" target="_self" class="text-[12px] font-normal tracking-[0.18px] block max-w-[170px] menu-l2-desktop">Our Journey</a>
 
Top