remykits
remykits

Reputation: 1775

apache virtualhost link error

I run a wordpress on AWS, the public domain assigned by AWS is "ec2-23-23-124-60.compute-1.amazonaws.com", and the virtualhost setting is as following:

<VirtualHost *:80>
        ServerName remykits.com
        DirectoryIndex index.php
        DocumentRoot "/home/mysite/sites/blog"
        LogLevel info
        ErrorLog  /var/www/vhosts/domain.com/log/error.log
        CustomLog /var/www/vhosts/domain.com/log/access.log combined
</VirtualHost>

but when I click a link in my blog, the url changes to "http://ec2-23-23-124-60.compute-1.amazonaws.com/", I have no idea how to solve it.

Upvotes: 0

Views: 101

Answers (2)

Sajan Parikh
Sajan Parikh

Reputation: 4940

This needs to be fixed with Wordpress. Wordpress generates links and URLs on your page based on the domain name in the database. Which seems to be ec2-23-23-124-60.compute-1.amazonaws.com. This usually happens when someone installs Wordpress by going to that domain name, rather than your actual domain name (remykits.com). People usually do this because they want to install Wordpress on the server, but don't want to wait for the domain name to point to the server IP while DNS propagates.

Wordpress has a well written Codex page on how to change the domain your Wordpress installation uses. While the codex article goes into detail on how to make these changes manually, the following is all you really need to do.

On the Settings->General screen in a single site installation of WordPress, there are two >fields named "WordPress address (URL)" and "Site address (URL)". These are also known as >the "Home" and "Site URL" settings. They are important settings, since they control where >WordPress thinks your site is located. They control the display of the URL in the admin >section of your page as well as the front end, and are used throughout the WordPress code.

The "Home" setting is the address you want people to type in their browser to reach >your WordPress blog.

The "Site URL" setting is the address where your WordPress core files reside.

Note: Both settings should include the http:// part and should not have a slash "/" at the >end.

Wordpress Codex - Changing The Site URL

Upvotes: 0

hohner
hohner

Reputation: 11588

I think this more of a Wordpress issue than an Apache one. Go into your Admin panel, go to Options and change your Site URL to point to remykits.com. Your links should now use this as the base_url for the site.

If your Apache configuration was incorrect, your Wordpress installation would most likely not even render. Your ServerName is correct, which is the most important thing.

Upvotes: 1

Related Questions