我的htaccess文件有问题。
我的主域kielkowski-szkolka.pl
指向根文件夹
/kielkowski-szkolka.pl/public_html
现在,我创建了子域automatyka.kielkowski-szkolka.pl
,其点数为/kielkowski-szkolka.pl/public_html/automatyka
现在,当我尝试转到automatyka.kielkowski-szkolka.pl
时,它会将我重定向到我的主域/
kielkowski-szkolka.pl
您可以查看我的根htaccess
并告诉我要添加/更改的内容以使其正常工作吗?
SetEnv PHP_VER 5
php_flag apc.enabled On
php_flag apc.cache_by_default On
php_value session.gc_maxlifetime 86400
php_value session.cookie_lifetime 86400
Options +FollowSymLinks
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
#przekierowanie z http na https i z ww na bez www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^kielkowski-szkolka.pl [NC]
RewriteRule ^(.*)$ https://kielkowski-szkolka.pl%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} !^on$
RewriteRule ^(.*)$ https://kielkowski-szkolka.pl/$1 [R=301,L]
# Redirect non-existing files or folders to index
# Redirect non-existing files or folders to index
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ / [L,QSA,R=301]
</IfModule>
答案 0 :(得分:2)
您可以检查您的子域名,然后重定向到这样的文件夹,例如。
RewriteCond %{HTTP_HOST} ^automatyka\.kielkowski-szkolka\.pl$
RewriteRule ^(.*)$ http://kielkowski-szkolka.pl/automatyka/$1 [L,R=301]