2017-08-17 48 views
0

我有这个.htaccess文件错误格式固定htaccess文件

RewriteEngine onRewriteCond %{HTTP_HOST} ^example\.com$ [OR] 
RewriteCond %{HTTP_HOST} ^www\.example\.com$ 
RewriteRule ^/?$ "http\:\/\/jedpanel\.com\/" [R=301,L] 
# Use PHP5.4 as default 
AddHandler application/x-httpd-php54 .php 
# BEGIN WordPress 
<IfModulemod_rewrite.c> 
RewriteEngine OnRewriteBase 
/RewriteRule^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule> 

# END WordPress 

,但我有一个问题。当我保存它时出错了,格式改变了。我试图修复它,但这是我得到的。任何人都可以请修复它,因为网页给出500 Internal Server error

回答

0

现在就来试试:

RewriteEngine on 

RewriteCond %{HTTP_HOST} ^xinlongboard\.com$ [OR] 
RewriteCond %{HTTP_HOST} ^www\.xinlongboard\.com$ 
RewriteRule ^/?$ "http\:\/\/jedpanel\.com\/" [R=301,L] 

# Use PHP5.4 as default 
AddHandler application/x-httpd-php54 .php 

# 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 

我不太清楚你在做什么搞乱格式像你一样。下一次只通过您的主机进行编辑,可以防止这种混乱。

+0

我tryng使用gzip压缩档,但它没有工作,不知道为什么:/ –

+0

什么是你使用编辑文件?要像保存时一样更改格式,只能表示您正在使用某种类型的不寻常编辑器。 – Lag

+0

我用记事本。 –

0

我自己修复了。 这里是代码,如果有人感兴趣:

RewriteEngine on 
 
RewriteCond %{HTTP_HOST} ^xinlongboard\.com$ [OR] 
 
RewriteCond %{HTTP_HOST} ^www\.xinlongboard\.com$ 
 
RewriteRule ^/?$ "http\:\/\/jedpanel\.com\/" [R=301,L] 
 
# Use PHP5.4 as default 
 
AddHandler application/x-httpd-php54 .php 
 
# 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