简体   繁体   中英

Wordpress:500 internal server error after changing url

My domain ( example.com ) is pointed to public_html/cushbu it contains a wordpress project

so i've changed the settings in wp-config file

 define('WP_HOME','http://example.com');
  define('WP_SITEURL','http://example.com');

Also in .htaccess file thats under pubic_html/cushbu folder

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

# END WordPress


# Wordfence WAF

<Files ".user.ini">
<IfModule mod_authz_core.c>
    Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
</IfModule>
</Files>

# END Wordfence WAF

#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] 

I got 500 error when accessing my domain ( www.example.com )

Remove example.com in .htaccess from the RewriteBase and RewriteRule . It is probably easiest for you to rename the file to bck.htaccess and let wordpress generate a new one for you.

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