2012-08-08 41 views
0
隱藏問號

我在做什麼錯? 我有一個鏈接:.htaccess從地址

<a href="norma/something1/something2/something3/">Link Name</a>

我需要從陳詞: eshop.mydomain.com/norma/something1/something2/something3/
這個地址:
eshop.mydomain.com/norma-something1-something2-something3.html

我能做的唯一事情就是
eshop.mydomain.com/?norma-something1-something2-something3.html

我需要隱藏問號,但我沒有任何想法如何:(

這裏是我的.htaccess

#php_value memory_limit 256M 
RewriteEngine On 
RewriteBase/
RewriteRule /index.php/[R=301] 

RewriteRule ^norma/([^/]+)/([^/]+)/([\d\.]+)$ %{DOCUMENT_ROOT}/index.php?$1-$2&-$3.html [L,QSA] 

ErrorDocument 404 /doc/e404/ 

回答

0

你還說問號在你重寫規則:

# right here -----------------------------------------------------------v 
RewriteRule ^norma/([^/]+)/([^/]+)/([\d\.]+)$ %{DOCUMENT_ROOT}/index.php?$1-$2&-$3.html [L,QSA] 

但我懷疑它可能是一對夫婦的事情,是造成這個重定向發生在它真的應該在服務器端進行內部重寫時發生。試着改變你的規則是:

RewriteEngine On 
RewriteBase/

# this L is important ------------v 
RewriteRule ^/?index.php/[R=301,L] 

RewriteRule ^norma/([^/]+)/([^/]+)/([\d\.]+)$ /index.php?$1-$2&-$3.html [L,QSA] 
+0

如果我用這個,我的網頁拋出錯誤
'感動永久
該文件已移至此處。 此外,在試圖使用ErrorDocument來處理request.' 這裏遇到一個404 Not Found錯誤是代碼:

'#php_value memory_limit的256M RewriteEngine敘述在 RewriteBase/ 重寫規則^ /指數。 php/[R = 301,L] RewriteRule^norma /([^ /] +)/([^ /] +)/([\ d \。] +)$%{DOCUMENT_ROOT} /index.php? $ 1- $ 2- $ 3.html&pa = norma&stupen = $ 1&cislo = $ 2&datum = $ 3 [L,QSA] ErrorDocument 404/doc/e404 /' – 2012-08-08 05:18:19

+0

@LeníkRostík當錯誤文檔顯示'搬到這裏。「? – 2012-08-08 05:31:19