Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2009
    Location
    Lawrence, KS
    Posts
    125

    .htaccess rewrite rule

    Hello,

    Recently I moved my WHMCS install which has broken a PayPal IPN. Currently I have this redirect in place:

    RewriteCond %{HTTP_HOST} ^rockandrollhosting.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.rockandrollhosting.com$
    RewriteRule ^clients\/?(.*)$ "http\:\/\/my\.rockhost\.com\/$1" [R=301,L]

    However, there is one single url behind /client that I need to be the exception to the rule: https://www.rockandrollhosting.com/c...ack/paypal.php

    I have Google'd myself googly eye'd without much luck. Any ideas?

    Thanks!

  2. #2
    RewriteCond %{REQUEST_URL} !^/clients/modules/gateways/callback/paypal\.php$
    Adam McMaster

    Valcato HostingSince 2002

  3. #3
    Join Date
    Mar 2009
    Location
    Lawrence, KS
    Posts
    125
    Hmm...I'm afraid that didn't work. Does it matter where I add that line in my .htaccess file? Thanks.

  4. #4
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    857
    Use the ignore rule:

    RewriteRule ^(folder|anotherfolder|images|clients)(/.*)?$ - [NC,L]

    Hope this helps

  5. #5
    Join Date
    Mar 2009
    Location
    Lawrence, KS
    Posts
    125
    Well I got a 404 Not Found error with that syntax. Should I modify any of that code beside the directory names? I used:

    RewriteRule ^(clients|modules|gateways|callback)(/.*)?$ - [NC,L]

    The actual file is /clients/modules/gateways/callback/paypal.php

    Thanks!

  6. #6
    Join Date
    Jun 2007
    Location
    London, United Kingdom
    Posts
    857
    The full .htaccess file should look something like this for you (just based on the ignore rule):


    RewriteEngine on
    RewriteBase /
    # ignore following directories
    RewriteRule ^(clients|modules|gateways|callback)(/.*)?$ - [NC,L]

  7. #7
    Join Date
    Mar 2009
    Location
    Lawrence, KS
    Posts
    125
    Well, that creates a 404 Not Found error for the actual url I'm trying to fix and stops the wildcard redirect altogether.

    What the hell... How would you edit this?
    --------------------
    RewriteEngine on

    # -FrontPage-

    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>

    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>

    AuthName www.rockandrollhosting.com
    AuthUserFile /home/rockandr/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/rockandr/public_html/_vti_pvt/service.grp

    Options +FollowSymLinks

    AddType application/x-httpd-php .shtml

    RewriteCond %{HTTP_HOST} ^rockandrollhosting.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.rockandrollhosting.com$
    RewriteRule ^clients\/?(.*)$ "http\:\/\/my\.rockhost\.com\/$1" [R=301,L]

  8. #8
    Quote Originally Posted by Seth Cole View Post
    Hello,

    Recently I moved my WHMCS install which has broken a PayPal IPN. Currently I have this redirect in place:

    RewriteCond %{HTTP_HOST} ^rockandrollhosting.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.rockandrollhosting.com$
    RewriteRule ^clients\/?(.*)$ "http\:\/\/my\.rockhost\.com\/$1" [R=301,L]

    However, there is one single url behind /client that I need to be the exception to the rule: https://www.rockandrollhosting.com/c...ack/paypal.php

    I have Google'd myself googly eye'd without much luck. Any ideas?

    Thanks!
    Why you want to do this?

    Just change your whmcs paypal callback link in your paypal
    Dewlance® Shared/Reseller/Master Reseller - US/UK/EU/FRK/CA - SSD
    WHMCS ReadyMadeKB - Tutorials for cPanel/InterWorx/Softaculous& Growing..
    DemoTiger.com - Buy Demo Videos for your Hosting Company

  9. #9
    Join Date
    Mar 2009
    Location
    Lawrence, KS
    Posts
    125
    Because that doesn't work for existing subscriptions. I have a ticket open with PayPal and WHMCS. Trust me, this is the proper solution.

  10. #10
    ok,

    I am sorry if I am wrong


    Redirect 301 /clients/modules/gateways/callback/paypal.php http://rockandrollhosting.com/client...ack/paypal.php
    Dewlance® Shared/Reseller/Master Reseller - US/UK/EU/FRK/CA - SSD
    WHMCS ReadyMadeKB - Tutorials for cPanel/InterWorx/Softaculous& Growing..
    DemoTiger.com - Buy Demo Videos for your Hosting Company

Similar Threads

  1. (Basic) Joining rewrite rule in htaccess
    By basketmen in forum Programming Discussion
    Replies: 1
    Last Post: 09-26-2010, 01:26 PM
  2. .htaccess rewrite rule problem - need help
    By l0ck_up in forum Programming Discussion
    Replies: 8
    Last Post: 07-18-2008, 10:52 PM
  3. Rewrite rule in .htaccess file take too much process
    By renegate_7 in forum Web Hosting
    Replies: 1
    Last Post: 09-17-2006, 08:02 PM
  4. .htaccess rewrite rule
    By PostiniWholesaler in forum Web Design and Content
    Replies: 1
    Last Post: 11-22-2005, 12:44 PM
  5. [htaccess] Simple Rewrite Rule (! gets treated as ?)
    By Barti1987 in forum Programming Discussion
    Replies: 7
    Last Post: 04-22-2005, 05:48 AM

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
  •