Htaccess help

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch
Impact
44
Gents

IS this the correct code to put into an htacess file to do a 301 redirect so that all iphone traffic will redirect to url.ext for example and keep the affiliate code?

RewriteCond %{HTTP_USER_AGENT} ^.*iphone.*$ [NC]
RewriteRule ^(.*)$ http:/url.ext/?code=000&code=000 [R=301,L]

?code=000&code=000 is the affiliate code

Thanks in advance
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
bump
 
0
Close
anyone?
 
0
Close
Do you have Cpanel? you can set a re-direct through Cpanel a lot easier.
 
0
Close
Thanks for replying kbm and no I don't on this particular server, so I thought that by editing the htacess there would not be a problem redirecting certain types of traffic to different sites with different affiliate codes. Is this not going to work how I have set it out above?
 
0
Close
I have not tested your code but it looks OK at first glance. Did you try it ? If it doesn't work I will test on my server.
 
1
Close
Thanks for replying to me sdsinc :) It seems to work fine on my server and if it is not too much trouble, I would very much appreciate you trying it on yours too please. I just need a double check for my peace of mind. Thanks :)
 
0
Close
Worked fine for me. Use

Code:
RewriteCond %{HTTP_USER_AGENT} ip(hone|od) [NC]
RewriteRule ^.* http:/url.ext/?code=000&code=000 [R=301,L]

If you want to redirect ipods too. There are scripts on DetectMobileBrowser.com that can redirect other phones as well.
 
1
Close
Many thanks chadsmith :) I bought Andy Moore's script awhile back and am using that also, but I was looking an htacess way of doing this as a standalone too.
 
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back