I have main domain http://example.com on my root directory and all of my subdomains are in catalogs folder /catalogs/subdomain1,/catalogs/subdomain2.Currently my subdomain url in http://subdomain.example.com/index.php
I want to remove index.php from my subdomain.
My Root .htaccess file code is
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect on https:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
My Subdomain .htaccess
RewriteEngine on
# Redirect on https:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ 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
Answers
Please use below code and update RewriteBase /root_directory/subdomain_folder_name/ at your .htaccess file.
I hope this will helpful for you.
Try this