如何在 codeigniter 的多个项目中编辑 htaccess 文件和 index.php 文件
How to edit htaccess file and index.php file in multiple project in codeigniter
如何在 codeigniter 中编辑多个项目中的 .htaccess
文件和 index.php
文件以在其他项目中创建基础 url?
尝试阅读此文档Managing your Applications
然后试试这个 .htaccess 代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mywebsite
# Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
# Prevents user access to the application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
写入单个端口 htaccess
端口 2[
index.php //($application_folder = 'application/port2';) //设置这个路径
.htaccess//端口2
]
端口 3[
index.php //($application_folder = 'application/port3';)//设置这个路径
.htaccess//端口 3
]
application [
port1[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
port2[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
port3[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
]
//root directory is port 1
index.php // ($application_folder = 'application/port1';)//set this path
.htaccess //端口 1
如何在 codeigniter 中编辑多个项目中的 .htaccess
文件和 index.php
文件以在其他项目中创建基础 url?
尝试阅读此文档Managing your Applications
然后试试这个 .htaccess 代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mywebsite
# Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
# Prevents user access to the application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
# Checks to see if the user is attempting to access a valid file,
# such as an image or css document, if this isn't true it sends the
# request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/ [L]
RewriteRule ^(.*)$ pro1.php?/ [L]
RewriteRule ^(.*)$ pro2.php?/ [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
写入单个端口 htaccess
端口 2[
index.php //($application_folder = 'application/port2';) //设置这个路径
.htaccess//端口2
]
端口 3[
index.php //($application_folder = 'application/port3';)//设置这个路径
.htaccess//端口 3
]
application [
port1[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
port2[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
port3[
config[
config.php
-> $config['index_page'] = ''; //set blank
]
]
]
//root directory is port 1
index.php // ($application_folder = 'application/port1';)//set this path
.htaccess //端口 1