迁移后的htaccess配置

时间:2017-05-30 13:36:17

标签: php apache .htaccess redirect migration

我已将我的网站从rcitickets.com移至adilhorki.com以进行测试和开发。起初,我收到了消息:

  

内部服务器错误

没有任何作用。

htaccess的:

RewriteEngine on
Options +FollowSymLinks -Indexes
RewriteRule ^event.php /event [NC,R,L]
#RewriteCond $1 !^(media/|system/)
RewriteCond $1 !^FB8568797C398407CDE6568C19EE7FF7.txt
RewriteRule ^(.*)$ /public/$1 [L]

public / htaccess:

# SetEnv APP_ENV production
AddDefaultCharset UTF-8
Header unset ETag
FileETag None
<Files ~ "\.cache">
Order allow,deny
Deny from all
</Files>
<Files ~ "\.log">
Order allow,deny
Deny from all
</Files>
<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
#The following line also enables compression by file content type, for the 
following list of Content-Type:s
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 g  zip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
</IfModule>
<IfModule mod_headers.c>
# YEAR
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header set Cache-Control "max-age=29030400"
</FilesMatch>
# WEEK
<FilesMatch "\.(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
# 45 MIN
<FilesMatch "\.(html|htm|txt)$">
Header set Cache-Control "max-age=2700"
</FilesMatch>
</IfModule>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_rewrite.c>
Options +FollowSymLinks -Indexes
RewriteEngine on
# deal with php5-cgi first
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
<IfModule !mod_fcgid.c>
# for normal Apache installations
    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    # for Apache FGCI installations
    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
    </IfModule>
</IfModule>
</IfModule>
#TEST FORCE https://www.adilhorki.com
RewriteCond %{HTTPS_HOST} ^(www.)?adilhorki.com$
RewriteRule ^(/)?$ https://www.adilhorki.com [L]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#PASAR A HTTPS
#RewriteCond %{SERVER_PORT} 80 
#RewriteRule ^(.*)$ https://adilhorki.com/$1 [R,L]
#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://%1 [R=301,QSA,NC,L]
#RewriteCond %{HTTPS} on
#RewriteCond %{HTTPS_HOST} ^www\.(.*)
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L] 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]

当我删除这一行时:

RewriteRule ^(.*)$ /public/$1 [L]
来自htaccess

仅适用于部分使用www.adilhorki.com/public(未加载媒体目录除外)。虽然我的CMS工作正常www.adilhorki.com/public/system

我需要修改什么?

0 个答案:

没有答案