Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htaccess从地址隐藏问号_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache .htaccess从地址隐藏问号

Apache .htaccess从地址隐藏问号,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我做错了什么? 我有一个链接: 我需要在以下地址填写地址: eshop.mydomain.com/norma/something1/something2/something3/ 此地址: eshop.mydomain.com/norma-something 1-something 2-something 3.html 我唯一能做的就是 eshop.mydomain.com/?norma-something1-something2-something3.html 我需要隐藏问号,但我不知道如何:

我做错了什么? 我有一个链接:

我需要在以下地址填写地址:
eshop.mydomain.com/norma/something1/something2/something3/

此地址:
eshop.mydomain.com/norma-something 1-something 2-something 3.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/

您正在重写规则中添加问号:

# 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]

如果我使用此选项,我的页面将抛出错误
永久移动
文档已移动到此。此外,在尝试使用ErrorDocument处理请求时遇到404 Not Found错误。
以下是代码:

值内存限制256M RewriteBase/RewriteRule^/index.php/[R=301,L]重写规则^norma/([^/]+)/([^/]+)/([\d\.]+)$%{DOCUMENT_ROOT}/index.php?$1-$2-$3.html&pa=norma&stupen=$1&cislo=$2&datum=$3[L,QSA]ErrorDocument 404/doc/e404/@LeníkRostík当错误文档显示
文档已移动到此处时,链接指向什么。
?文档已移动。请问哪里有问题?@LeníkRostík我不知道,您可以尝试删除
RewriteRule^/?index.php/[R=301,L]
行,不确定你想用它做什么。你也可以像我在回答中所做的那样,从上一条规则中删除
%{DOCUMENT\u ROOT}