dongqing5925 2019-02-21 18:59
浏览 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 2019-02-26 08:11
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动