Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 Magneto 的 URL 重写管理来重定向一堆页面。但是,URL 带有附属信息,即www.mysite.com/?aff=123 当 Magneto 重定向到正确的页面时,它会丢失 aff=123。
www.mysite.com/?aff=123
我怎样才能保存这些信息?
实际上,在 Magento 内部没有办法做到这一点。您需要在 Apache mod_rewrite 编辑 .htaccess 文件上执行此操作,并将[QSA](查询字符串附加)放在重定向行的末尾。
例如:
RewriteRule somedir/(.*) somedir2/$1 [QSA]
它会重定向
www.mysite.com/somedir/hello.php?test=1
至
www.mysite.com/somedir2/hello.php?test=1