我已將我的codeigniter項目和所有相關數據庫從舊服務器(Centos 5.11)移至新服務器(Centos 6.7)。在舊服務器中,從URL中刪除index.php的任務已經在.htacess文件和其他更改的幫助下處理完畢。我已將整個項目移到新服務器上,而無需進行任何更改。當我訪問該項目的主頁面,即登錄頁面時,它工作正常,並且沒有任何問題顯示。但是我登錄的那一刻,我收到一個404錯誤頁面。但是,當我在需要的地方添加index.php片段,那麼它的工作原理!將項目移至最新的服務器版本是否會導致問題?從URL Codeigniter刪除index.php 1.7.2
0
A
回答
0
RewriteEngine On
Options All
#php_flag display_errors Off
#php_value error_reporting 1
#php_value post_max_size 8M
#php_value upload_max_filesize 8M
#php_value memory_limit 150M
# These settings when uncommented, giving 500 Internal Server Error on
# the new server http://119.18.48.12
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^/(.*).php /uat/index.php/$1.php [L,NC]
RewriteRule ^/(.*).php index.php/$1.php [L,NC]
#Local Server Setting
#RewriteRule ^admin/(.*) administration.php/$1 [L,NC]
#LIVE Server setting
RewriteRule ^admin/(.*) /uat/administration.php/$1 [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Local Server Setting
#RewriteRule ^(.*)$ index.php/$1 [L]
#LIVE Server setting
RewriteRule ^(.*)$ /uat/index.php/$1 [L]
+0
從路徑中刪除/ uat。 –
+0
是否做到了。現在它說沒有指定輸入文件! –
+0
我使用IP地址而不是域名來訪問新服務器上的項目。這是一個值得關注的情況嗎? –
0
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
#RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC]
#RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC]
#RewriteRule \.(jpe?g|gif|bmp|png)$ - [F]
</IfModule>
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
<IfModule mod_headers.c>
Header add Cache-Control: "no-store, no-cache, must-revalidate"
Header unset Pragma
FileETag None
Header unset ETag
</IfModule>
#End Gzip
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
相關問題
- 1. 從URL刪除index.php - Codeigniter 2
- 2. 從url中刪除index.php Codeigniter
- 3. 從CodeIgniter 3 URL刪除index.php
- 4. codeIgniter Index.php從URL中刪除
- 5. 從CodeIgniter URL中刪除index.php
- 6. 刪除Codeigniter URL中的index.php
- 7. codeigniter刪除index.php表單url
- 8. 我無法從CodeIgniter URL中刪除index.php
- 9. CodeIgniter:無法從URL中刪除index.php
- 10. 如何從CodeIgniter的URL中刪除index.php?
- 11. 從codeigniter中的url中刪除index.php
- 12. Codeigniter 3.1.6 - 如何從url中刪除index.php
- 13. 如何從CodeIgniter的URL中刪除'index.php'?
- 14. Codeigniter - 刪除index.php
- 15. 從Codeigniter網站刪除index.php
- 16. 強制從codeigniter刪除index.php
- 17. 從codeigniter中刪除index.php 2.1.3
- 18. Codeigniter刪除/index.php/class
- 19. Codeigniter Xampp刪除index.php
- 20. CodeIgniter:在WAMP上刪除URL中的「index.php」
- 21. 刪除codeigniter的index.php
- 22. 從wordpress URL刪除index.php
- 23. 從joomla url刪除index.php 2.5
- 24. Htaccess從URL中刪除Index.php
- 25. 從url中刪除index.php
- 26. Magento從URL刪除index.php
- 27. 從子域URL刪除Index.php
- 28. 從URL刪除index.php,Laravel 5.2
- 29. 從URL中刪除/index.php/ .htacess
- 30. 刪除的index.php從URL
顯示您的htaccess。我們不能只用文字幫助.. –
Codeigniter 1.7.2。是非常過時的,現在他們達到3.0.6版本http://www.codeigniter.com/download – user4419336
是的,我知道!但我們不考慮升級 –