Portal Home > Knowledgebase > Articles Database > .htaccess rewrite rule
.htaccess rewrite rule
Posted by rockhost, 05-24-2011, 10:05 AM |
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!
|
Posted by ValcatoAdam, 05-24-2011, 10:24 AM |
RewriteCond %{REQUEST_URL} !^/clients/modules/gateways/callback/paypal\.php$
|
Posted by rockhost, 05-24-2011, 10:30 AM |
Hmm...I'm afraid that didn't work. Does it matter where I add that line in my .htaccess file? Thanks.
|
Posted by AeonCube, 05-24-2011, 11:35 AM |
Use the ignore rule:
RewriteRule ^(folder|anotherfolder|images|clients)(/.*)?$ - [NC,L]
Hope this helps
|
Posted by rockhost, 05-24-2011, 11:49 AM |
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!
|
Posted by AeonCube, 05-24-2011, 12:16 PM |
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]
|
Posted by rockhost, 05-24-2011, 12:24 PM |
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*
order deny,allow
deny from all
allow from all
order deny,allow
deny from all
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]
|
Posted by DewlanceHosting, 05-24-2011, 02:11 PM |
Why you want to do this?
Just change your whmcs paypal callback link in your paypal
|
Posted by rockhost, 05-24-2011, 02:25 PM |
Because that doesn't work for existing subscriptions. I have a ticket open with PayPal and WHMCS. Trust me, this is the proper solution.
|
Posted by DewlanceHosting, 05-24-2011, 02:38 PM |
ok,
I am sorry if I am wrong
Redirect 301 /clients/modules/gateways/callback/paypal.php http://rockandrollhosting.com/client...ack/paypal.php
|
Add to Favourites Print this Article
Also Read
amazed.net (Views: 457)