简体   繁体   中英

After I set my wordpress server elastic ip in aws ec2,my wordpress can't request static file

I build a wordpress in aws EC2,everything goes well until I bind a Elastic IP to my wordpress server. The question is wordpress static file request is still the default aswec2 public dns, but I can see the page without css/js.

Web server:apache2;Database: aws RDS(mysql);php version:5.3.10;My wordpress address: www.aoaostudio.com ;

Because before I bind a Elastic IP, I visit the aws public dns:ec2-***-.ap-northeast-1.compute.amazonaws.com ,my wordpress blog is ok!

I feel my apache2 configuration maybe wrong, the configuration file is as follows:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName www.aoaostudio.com
        DocumentRoot /var/www/wordpress
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/wordpress>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

I have no idea about php, maybe my question is fool, but I hope someone can give a help.

You probably installed wordpress while you didn't have the elastic IP, so Wordpress remembered your URL as ec2-...

There is a tutorial for changing the URL of your Wordpress installation here . Follow it, using www.aoaostudio.com as your URL.

Basically, what you need to do is to add these lines at the top of the functions.php file, right after the opening <?php tag:

update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Then just load the admin login page a few times, and the URLs should update. It's very important that after all URLs are updated, you remove the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM