Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,744
    Thanks
    29
    Thanked 4 Times in 4 Posts

    Mod rewrite a variable not getting passed ?

    Hi

    I thought I had got this correct but it seems my variable
    is not getting passed

    My input url is:

    example.com/discounts/HY73BGSTF888-a-Roller-Derby-Tracer-Inline-Skates.html


    This is what I have in the .htaccess

    # REDIRECTING TO SELLER
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^discounts/(.*)-a- http://some-other-site.com/%1?key=fethmykey [NC,QSA,L]

    The result I want is :
    http://some-other-site.com/HY73BGSTF888?key=fethmykey [NC,QSA,L]

    But the resultant page goes to the index page, not the product page relating to HY73BGSTF888

    Can you see what I have done wrong with my rewrite ?

    Thanks
    David.
    Last edited by jeddi; 08-20-2016 at 10:07 AM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  2. #2
    Senior Coder
    Join Date
    May 2006
    Posts
    1,744
    Thanks
    29
    Thanked 4 Times in 4 Posts
    I have tried a similar rewrite using a shortened url
    but it is still not redirecting.

    This is my url:

    -->ww.example.com/discounts/2bEcQPm-a-Horizon-Fitness-T101-04-Treadmill-Review.html

    and this is the -haaccess

    # REDIRECTING TO SITE with SHORT CODE E.G http://site.to/2bEcQPm
    RewriteCond %{HTTP_HOST} ^www.example\.com$ [NC]
    RewriteRule ^discounts/(.*)-a- http://site.to/$1

    But I get a 404 error !

    Any suggestions ?

    .
    Last edited by jeddi; 08-21-2016 at 05:33 PM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  3. #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,744
    Thanks
    29
    Thanked 4 Times in 4 Posts
    I have tried putting escapes in front of the periods like this :

    # REDIRECTING TO SITE with SHORT CODE E.G http://site.to/2bEcQPm
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule ^discounts/(.*)-a- http://site.to/$1

    AND WITH NO escapes, like this:

    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteRule ^discounts/(.*)-a- http://site.to/$1

    BUT I STILL GET THE 404.

    I checked that http://site.to/2bEcQPm does actually
    go to the correct page, and it does.

    So I do seem to have a problem with this simple rewrite
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  4. #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,744
    Thanks
    29
    Thanked 4 Times in 4 Posts
    Hi,
    I would really appreciate any help with this
    because I can't figure our why it is not working

    Thanks
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •