not sure if this helps much, but the above code works fine for me on an iPhone3, as well as an iPad2.
That is to say, if I copy this into a .htaccess file in my site’s root, I get redirected to mydomain.com/news/ as soon as I hit the site on either of those devices.
I did have an issue recently with a browser (either Chrome or FF) caching redirects, which caused me endless amounts of pain.
Would it maybe help to clear your browsing data?
@Pullo Thanks for checking it. I should have mentioned that it is a Wordpress install. I’ve been trying to fix this for so long my brain is not working! I tried that snippet on a normal html page and the htaccess redirect worked so maybe it has problems with the Wordpress rewrite rules.
@euro-space I tried your solution but unfortunately that solution didn’t work. I also tried another PHP based solution but I get the same error as the htaccess. Seems to be stuck in an infinite redirect loop.
I’m stumped!
Thanks again for your help guy’s. I’ll keep trying.
[rant #4][indent]The definition of an idiot is someone who repeatedly does the same thing expecting a different result. Asking Apache to confirm the existence of ANY module with an <IfModule> … </IfModule> wrapper is the same thing in the webmaster world. DON’T BE AN IDIOT! If you don’t know whether a module is enabled, run the test ONCE then REMOVE the wrapper as it is EXTREMELY wasteful of Apache’s resources (and should NEVER be allowed on a shared server).[/indent][/rant 4]
Okay, on to the code being attempted (DELETE the code in red):
I make these “corrections” every time I see the WordPress code. Hopefully, one day they will understand mod_rewrite code and I won’t have to repeat this “repetitively.” Please note that WP uses the <IfModule> wrapper to prevent annoying complaints from “webmasters” who do not understand .htaccess use. If mod_rewrite is enabled, it’ll work. If it isn’t, you’ll get a 500 error and can eliminate the mod_rewrite code BECAUSE Apache does not recognize its directives.
To the OP’s problem, I believe that the quotes were in error and a parenthetical was in order (to select one of the set of items within the parentheticals).
@Pullo I tried your suggestion but it didn’t work, sadly.
@dklynn First thanks for the help, I will try what you suggest. However, I DO NOT appreciate being called an idiot. I have only been programming in PHP and using linux servers for about a year so I still have a lot to learn. I am here to learn not to have someone rant at me over the internet like a child. These forums are supposed to be somewhere you can ask questions when you need help, not have abuse thrown at you. Not everyone has the knowledge you seem to have so instead of being abusive how about educating the people who are asking for help in a constructive way? You have now been reported.
@dklynn, Thanks for that. I had no idea that using <IfModule> was such a bad practice. I’ve had a look through your mod_rewrite tutorial, too. Very informative!
The answer is not very exciting, I’m afraid: I was looking for an avatar, I liked the design of this one and it was free for personal use.
It was indeed entitled ‘pounamu koru’ which struck me as a strange name, so I googled it and read up on its significance.
I thought twice about whether to use it or not, but decided that it was unlikely that anyone would ask me about it …
You’ve got me on that one as I’d not seen that as an available avatar before. Frankly, it looks GOOD and I was rather shocked to see it here. I thought either you were a misplaced Kiwi or had been one of NZ’s many holiday visitors and had picked-up some local handcrafted items like this jade circle of live. Two :tup: :tup:
jon,
I was not calling you an idiot so my apologies for not making that clear. I do, however, have problems with “webmasters” who blindly use code whose function is unknown to them (IMHO, that’s unprofessional). I have made that comment too many times over too many years to repeat it at length every time I see that <IfModule> nonsense in .htaccess code that I had to create a Standard Rant to prevent Carpal Tunnel Syndrome. My series of rants have been useful to many others (e.g., Pullo above) who have taken them the way they were intended (an instructive “wake-up call”) rather than as a personal insult. I do not consider it useful to explain about CTS prevention in the rants nor about why “Standard Rants” were deemed necessary in the first place. As for my being able to educate people, I’ve been doing that far longer than … well, let’s say that I’ve helped many, many people over too many years to admit to. One or two others have initially taken mild offense but understood that my comments were not personal and used the various rants to help them learn and remember. I hope you will, too.
DK, Sorry for my over reaction. I guess I am just used to forums full of trolls who call other people stupid etc. if they don’t something. I understand your frustrations at repeating yourself but as I mentioned above I have not been coding PHP and using Linux servers long (I’m a front end developer by trade trying to get more strings to my bow by learning PHP, ASP etc). Before posting in this forum I searched Google for a solution which is where I got my code shown in the first post so I guess there are many websites out there with the wrong information.
Thanks for your help too btw, I tried what you suggested and it worked perfectly. I have bookmarked your website and will use for future reference as I continue learning PHP and Linux servers.