我的根目录中有主域http://example.com,我所有的子域都在目录文件夹 /catalogs/subdomain1,/catalogs/subdomain2.Currently 我的子域 url 在http://subdomain.example.com/index .php我想从我的子域中删除 index.php。我的根 .htaccess 文件代码是<IfModule mod_rewrite.c>RewriteEngine On# Redirect on https:RewriteCond %{HTTPS} offRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]RewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php?/$1 [L]</IfModule><IfModule !mod_rewrite.c> ErrorDocument 404 /index.php</IfModule>我的子域 .htaccessRewriteEngine on# Redirect on https:RewriteCond %{HTTPS} offRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]RewriteCond $1 !^(index\.php|resources|robots\.txt)RewriteCond %{ENV:REDIRECT_STATUS} ^$RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php/$1 [L,QSA]Options -Indexes# php -- BEGIN cPanel-generated handler, do not edit# Set the “ea-php56” package as the default “PHP” programming language.<IfModule mime_module> AddHandler application/x-httpd-ea-php56 .php .php5 .phtml</IfModule># php -- END cPanel-generated handler, do not edit
2 回答
繁星coding
TA贡献1797条经验 获得超4个赞
请使用以下代码并 在您的 .htaccess 文件中更新 RewriteBase /root_directory/subdomain_folder_name/。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /root_directory/subdomain_folder_name/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
我希望这对你有帮助。
- 2 回答
- 0 关注
- 152 浏览
添加回答
举报
0/150
提交
取消