dongqing5925
dongqing5925
2019-02-21 18:59

WP和子域的.htaccess文件

已采纳

I was trying to add SSL to a WP site that lives in a subdomain using this tutorial: https://www.youtube.com/watch?v=GPcznB74GPs .

All was working well and the site was responding to HTTPS until I edited the .htaccess file to try to force all traffic to SSL. Now I get "The requested URL / was not found on this server." on all domains (there are other sub domains that are siblings of the one I was editing and they are broken too).

After editing the .htaccess file and seeing the site was broken, I put the .htaccess file back the way it was but now it's still broken. I edited 2 files trying to fix this (public_html/.htaccess and public_html/mysubdomain.com/.htaccess) but have reverted each back to their original contents. Still no love.

The public_html/.htaccess is this:

# 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

#begin brad changes
php_value max_input_vars 3000
#end brad changes

and the public_html/mysubdomain.com/.htaccess file is this

# Switch rewrite engine off in case this was installed under HostPay.
RewriteEngine Off

SetEnv DEFAULT_PHP_VERSION 53


# 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

They are so plain vanilla I don't understand what could be going wrong.

Note that sibling sites (public_html/myOtherSite.com/) are also broken but i've not changed anything in those folders. This leads me to believe the main .htaccess file is messed up somehow.

I edited the files using GoDaddy's CPanel editor which asked me before opening the files if UTF8 was OK. Should that matter?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dsewbh5588 dsewbh5588 2年前

    It turns out this was user error. Apparently CPanel support drag/drop and I inadvertently dragged my public_html folder under public_ftp so all my files were "gone". When I put the public_html back, everything started working again.

    点赞 评论 复制链接分享

相关推荐