Toan Nguyen Phuoc
Toan Nguyen Phuoc

Reputation: 306

Broke CSS - When upload wordpress from local to hosting (what is inside .htaccess)

I upload WordPress from local to free hosting, but when I access my website, CSS was gone.

And I can't access wp-admin: https://fuukaa.000webhostapp.com/. When I access wp-admin so my URL move to localhost.

I use theme Avada, I think Avada didn't use. I changed file wp.configfollow my information setting host. Inside my .htaccess have:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

But it not work. Is my .htaccess wrong?

UPDATE HOW TO FIX THE ERROR

I open file function.php in my theme folder (I use theme Avada) and write inside 2 line code :

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

So my css, my theme are working now. Thank you all

Upvotes: 1

Views: 347

Answers (3)

Adeyemi Olusegun
Adeyemi Olusegun

Reputation: 51

Nothing is wrong with your .htaccess. I think your css file is missing or broken.

Upvotes: 0

mcmedal001
mcmedal001

Reputation: 146

It appears you haven't changed your siteurl in the database. You need to change that to the live url. Follow the steps below:

PhpMyAdmin

  1. Open phpMyAdmin on your live server
  2. Click your database in the left sidebar to load the tables
  3. Click on your wp_options table
  4. Find and edit the 'siteurl' and 'home' rows (Click the pencil icon to edit).
  5. Finally, click the "Go" button to save your changes.

I hope this helps.

Upvotes: 2

user10678889
user10678889

Reputation:

Seems your default siteurl is not changed into database.

Open your database/PHPMyadmin and go to wp_options table. Look for the siteurl and homeurl in the database and changed its value with your site's url.

Upvotes: 1

Related Questions