亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從子域嵌套文件夾中刪除 index.php

如何從子域嵌套文件夾中刪除 index.php

PHP
DIEA 2021-10-22 14:30:41
我的根目錄中有主域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>

我希望這對你有幫助。


查看完整回答
反對 回復 2021-10-22
  • 2 回答
  • 0 關注
  • 186 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號