Mobile app version of vmapp.org
Login or Join
Phylliss660

: .htaccess redirect based HTTP_REFERER Our webpage was redesigned and moved to a web CMS platform. This means some of our blog posts shared via Twitter just link to a 404 page. I am wondering

@Phylliss660

Posted in: #Apache #Htaccess #Linux #Redirects #WebHosting

Our webpage was redesigned and moved to a web CMS platform. This means some of our blog posts shared via Twitter just link to a 404 page.

I am wondering if it is possible using .htaccess or something to redirect the HTTP_REFERER to the new blog post page URL.

I have tried the following, however, it wasn't working. The HTTP_REFERER domain should be t.co but I couldn't post that in this message.

# Twitter Redirect old links
RewriteCond %{HTTP_REFERER} ^https://t.co/StrIngOfLeTTeRs
RewriteRule ^ www.example.com/new-blog-permalink/

Not sure where I am going wrong so any advice would be welcome.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

Shouldn't you be redirecting the blogs themselves instead? You would need to do so anyway to help the search engines and referral links. That way the page that the t.co links points to will get picked up by the .htaccess file, and then redirect to the new blog permalink.

Redirect 301 /StrIngOfLeTTeRs /new-blog-permalink/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme