简体   繁体   English

多视图和重定向问题

[英]Problems with Multiviews and redirecting

I recently deactivate the Multiview option in my htaccess file. 我最近在htaccess文件中停用了多视图选项。 It did the job perfectly, but we also use an external application that call a link with the extension file ( http://example.com/export_me?mode=csv&id=3 ) So the link does not work anymore and i want to use a rewrite rule to correct this error (i do not have access to the application) 它做得很好,但是我们也使用一个外部应用程序,该应用程序使用扩展文件( http://example.com/export_me?mode=csv&id=3 )调用链接,所以该链接不再起作用,我想使用用于纠正此错误的重写规则(我无权访问该应用程序)

RewriteCond %{REQUEST_URI} ^export_me?mode=(.*)&id=(.*)\$
RewriteRule (.*) export_me.php?mode=$1&id=$2 [L]

But i still have a 404 error. 但是我仍然有404错误。

Can anyone help me ? 谁能帮我 ?

Thx 谢谢

Try this: 尝试这个:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ export_me.php?/$1 [L] 
</IfModule>

Why not just simply: 为什么不简单地:

RewriteRule ^export_me$ /export_me.php [L]

The query string will get appended automatically. 查询字符串将自动追加。 You can't match against the query string in the %{REQUEST_URI} variable, only the `%{QUERY_STRING} variable. 您无法与%{REQUEST_URI}变量中的查询字符串进行匹配,只能与%% {QUERY_STRING}变量进行匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM