Domen
Domen

Reputation: 294

Openlitespeed 301 Moved Permanently problem

I have a new Openlitespeed server on Ubuntu, I have 2 domains pointing to the same IP, I tried to make a multidomain server so that www.domain1.com would point to one website and www.domain2.com to another.

I followed this tutorial.

Now when I go to domain1.com:80 it returns "CERR_CONNECTION_TIMED_OUT" and if I look at the network tab it shows: enter image description here

and redirects me to http://domain1.com:8080/

If I go to domain2.com:80 it's the same but it redirects me to 8088.

Before that, I was hosting two testing pages on 8080 and 8088, but I changed all the settings and can't find what is causing the redirections... (both websites are wordpress)

enter image description here

Upvotes: 2

Views: 194

Answers (2)

colossatr0n
colossatr0n

Reputation: 2375

The issue is with WordPress. WordPress stores siteurl and home as the first values they get set to. So in this case, your initial ports of 8080 and 8088 along with their domains/IPs get stored in WordPress and won't be updated with subsequent vhost/listener updates.

Update in WP-Admin

You can check the values by setting up the original vhosts/listeners, logging into the WordPress admin panel, and going to Settings > General. Check the values for WordPress Address (URL) and Site Address (URL). These are the values causing the redirect.

Update these values to the correct values, and reconfigure your vhost/listener setup to access your site again at the new URL.

Update in Database

The values can also be checked or updated through the database if you're SSH'd into the server.

Log in to the database and view the siteurl and home values in the wp_options table.

For MariaDB, run:

select * from wp_options where option_name in ('home', 'siteurl');

If these values are the orignal values, update them to the desired URLs and ensure your vhost/listeners setup matches.

Upvotes: 0

Domen
Domen

Reputation: 294

I managed to resolve this, something inside WordPress was redirecting.

I re-downloaded new WordPress and now it works.

Upvotes: 0

Related Questions