2014-12-29 46 views
0

我在opencart項目中遇到問題。我想使用htaccess將網址更改爲其他網址。使用htaccess更改OpenCart中的頁面URL

我們的鏈接是: -

http://domain.com/POSextension/index.php?route=pos/login

但我想以顯示它想:

http://domain.com/POSextension/pos

如何改變呢? PLZ幫我.. :(

+0

都是域' http:// pos.domain.com'和'http:// domain.com'指向相同的'DocumentRoot'目錄? – anubhava

+0

是的,這些指向同一目錄 –

+0

如何解決?@anubhava –

回答

0

您可以使用此代碼在您的DOCUMENT_ROOT/.htaccess文件:

RewriteEngine On 
RewriteBase/

RewriteCond %{HTTP_HOST} ^(?:www\.)?pos\.domain\.com$ [NC] 
RewriteRule ^(POSextension)/?$ $1/index.php?route=pos/login [L,QSA,NC] 

然而,如果/POSextension/.htaccess還存在,那麼使用這樣的規則:

RewriteEngine On 
RewriteBase /POSextension/ 

RewriteCond %{HTTP_HOST} ^(?:www\.)?pos\.domain\.com$ [NC] 
RewriteRule ^/?$ index.php?route=pos/login [L,QSA,NC] 
+0

它不工作... @anubhava –

+1

這種評論是沒有用的,因爲它沒有任何其他相關的細節。除了這個規則,絕對獨立工作,但我不能猜測你可能有什麼其他規則和htaccess。 – anubhava