NameSilo

Htaccess help

Spaceship Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
bump
 
0
•••
anyone?
 
0
•••
Do you have Cpanel? you can set a re-direct through Cpanel a lot easier.
 
0
•••
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
•••
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
•••
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
•••
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
•••
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
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back