Jump to content

Need a .htacess guru - help with HTTP_REFERER


Recommended Posts

I did have a rewrite set up in .htaccess to catch links coming from mysupplier.com to send to the supplier product page in my online store.  I recently found that it was no longer working (probably since the site migration from old to new host years ago).  The problem is that the link to www.mysite.com.au from https://www.mysupplier.com/en/retailer/online-stores/australasia/ is ending up at http://www.mysite.com.au instead of being captured by mod-rewrite and being redirected to https://www.mysite.com.au/shop/supplier-stuff.html
I can't see anything in .htaccess that would be pushing the link to http instead of https, even if the referrer is not being caught properly. Is there somewhere else in cPanel that might be pushing the referrer link to http before/over my rules in .htaccess?
This is the section in .htaccess that should be working:
RewriteEngine on
## Options +FollowSymLinks
RewriteCond %{HTTP_REFERER} ^https://.*mysupplier.*$ [NC, OR]
RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?mysupplier.*$ [NC]
RewriteRule ^(.*)$ https://www.mysite.com.au/shop/supplier-stuff.html [R,L]

Edited by jasehead
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...