2015-10-16 73 views
0

我在舊的服務器使用笨.htaccess的htaccess的在.htaccess文件與笨

我已經下列規則更改服務器

Options +FollowSymLinks 
RewriteEngine on 

RewriteRule ^transaction\.php$ index.php/printer_api/transaction/%1/%2/%3/%4/%5/%6/%7/%8 [L] 
RewriteRule ^getlist\.php$ index.php/printer_api/getlist [L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

它工作正常後,不能正常工作。 但移動網站的URL的.htaccess不工作 它顯示「輸入文件沒有指定」

在網上搜索後,我發現了一個解決方案,它是一種新的服務器後: 改變過去的規則專線:

RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

到(增加額外的只是後的index.php):

RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 

這解決了通用網址重寫與笨。

但我仍然有問題,以下部分的那些特異於單獨的URL:

RewriteRule ^transaction\.php$ index.php/printer_api/transaction/%1/%2/%3/%4/%5/%6/%7/%8 [L] 
RewriteRule ^getlist\.php$ index.php/printer_api/getlist [L] 

在第一URL有最多8個參數(但參數的數量可以在不同的情況下 並在變化第二個URL沒有參數。 但這些URL沒有在新服務器的工作。

現在可以請人幫助,使這兩個規則的工作。

回答

0

不知道它會工作,但是您是否嘗試過類似index.php的解決方案?例如:

RewriteRule ^transaction\.php$ index.php?/printer_api/transaction/%1/%2/%3/%4/%5/%6/%7/%8 [L] 
RewriteRule ^getlist\.php$ index.php?/printer_api/getlist [L] 
+0

不,它不起作用。它顯示頁面未找到錯誤。 –