Redirect rules on adult sites

Home Forums Newbie Helpdesk Redirect rules on adult sites

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #3740 Reply
    jeremyb
    Guest

    Hey, another tech question…

    After removing a really crappy “amp” plugin on my adult site, we need to redirect all url’s ending with /amp/ to the original (which now naturally delivers an amp version to mobile users).

    I’m guessing there’s a redirect method to do this rather than performing a thousand 301’s?

    Does anyone know what the format for that redirect would be? I don’t even know the terminology I would need to search under to find the solution to this.

    Many thanks, as always.

    #3741 Reply
    DOC
    Guest

    Well yes.. it gets a bit complicated:

    askapache.com/htaccess/m…e-tips-tricks/

    It would involve adding rules to htaccess file. I wonder if you are not just better off finding a plugin that handles this.

    #3742 Reply
    Marv
    Guest

    Try this code in your .htaccess file. Insert it after RewriteEngine On.

    RewriteCond %{REQUEST_URI} ^/amp/(.*)$
    RewriteRule ^(.*) yoursite.com/%1 [R=301,NC]

    #3743 Reply
    jeremyb
    Guest

    Thanks guys, I think that rewrite rule worked but I’ll monitor it for a few days and see what happens. It looks right to me but these things always make me nervous.

    #3744 Reply
    Mykel
    Guest

    Doesn’t that redirect everything that starts with /amp/ rather than ends with /amp/?

    #3745 Reply
    Marv
    Guest

    You’re right. But I’ve tried that redirection and it works for me, so I gave Conran that code.
    Of course, he could always try with RedirectMatch 301 ^/(.+)amp$ /$1 but I’m not sure about the result.
    I guess you have a better idea.

    #3746 Reply
    Mykel
    Guest

    The line should be…

    RewriteCond %{REQUEST_URI} ^(.*)/amp/$

    I can’t see how it would work at all if you did it the other way. No pages would get redirected because none of them start with /amp/ – they only end with /amp/

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Reply #3746 in Redirect rules on adult sites
Your information: