简体   繁体   中英

How to Change 302 Redirect to 301 Redirect in htaccess?

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?

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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