I
I
ingwar4ik2014-10-14 13:19:13
Yii
ingwar4ik, 2014-10-14 13:19:13

How to write redirect 410 for yii yii2?

You need to assign Status Code to old links: 410
tried in htaccess: Redirect 410 /old_link does not work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ingwar4ik, 2014-10-14
@ingwar4ik

I solved the problem by adding to the end of the ErrorDocument:

RewriteRule  ^old_link - [G]
ErrorDocument 410 default

A
Artur Bordenyuk, 2014-10-14
@HighQuality

I don't really understand what's going on, but:
Yii1:

//...
Yii::app()->getRequest()->redirect($link, true, 410);
//...

Yii2:
//...
Yii::$app->getResponse()->redirect($link, 410);
//...

I hope you understand why you need 410 status.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question