How to Change 302 Redirect to 301 Redirect in htaccess?

天大地大妈咪最大 提交于 2020-01-07 02:20:07

问题


Here's the code I have in my .htaccess:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /special/service
RewriteRule ^(.+)$  http://clients.example.com/aff.php?aff=$1&p=service.php [R,NC]

When I go the my redirect while running FireBug I'm seeing that it's actually a 302 redirect for some reason. What do I need to change to fix this?


回答1:


Add a =301 in your flags:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /special/service
RewriteRule ^(.+)$  http://clients.example.com/aff.php?aff=$1&p=service.php [R=301,NC]


来源:https://stackoverflow.com/questions/23706217/how-to-change-302-redirect-to-301-redirect-in-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!