When photographing protests and rallies, how do you show that you are not a protester and just a photographer to avoid police crowd control tactics? What do you do if the crowd you are in is getting particularly rowdy? Any other tips and best practices?
You don't, really.
On the one hand, the vast majority of protests are peaceful low-key sort of things where the police are just watching what's going on (if they're even there), or ensuring protests and counter-protests remain separate. They're basically not worried about you or what you're doing.
And on the other hand, if they've closed ranks, they're worried about everyone and they literally don't care if you're a protestor or "just a photographer." Press accreditation might get you through a police line, but even that's no guarantee; plenty of accredited journalists were caught up and detained in the G8/G20 protests in Toronto.
So, for the most part, being a photographer at the front line of a protest means you need to think in much the same way as a protestor at the front line:
Be aware of the overall situation. Are things getting hostile or escalating? Have the police blocked the route? Have they blocked all the routes (bad sign)? Are they demanding protestors move back? Is anyone provoking the situation?
It's usually safe. In fact, photographers will often be just as plentiful as protestors at the police line, as that's where the good pictures are. This was true even at the most violent protests during the Edinburgh G8 in 2005. You are more likely to get caught up in other people's scuffles, but that's what being at the front entails (see above about "being aware").
If people are being arrested, the police do not discriminate. You're in the crowd, it's easier for them to detain you and sort it out later. This entails being prepared to be arrested:
If the tear gas (etc) is being deployed, and you're on the wrong side of the police lines, it's basically out of your hands. Do not panic, try to stay out of any clashes, and stay away from anyone throwing anything back at the police (or be aware of the risk you're taking to get that particular picture). Staying where you are is often a surprisingly good choice. Do not assume having a camera means you aren't a target, if anything, assume the opposite. See above about being arrested.
NB: this is based on my experience in Canada, Switzerland, and the UK. Probably decent advice for most western-style developed democracies, though variations certainly exist. Concrete local knowledge will always trump general advice.
Matt covers a lot, but one specific tip would be to have a buddy to watch your back.
If you're taking photos you have that very specific focus and won't be so aware of the general situation around you. So having someone you trust who will commit to sticking with you throughout the day and not having any other focus will make a huge difference.
As others say most protests are pretty quiet affairs, but if you think there is a serious risk of violence (whether from the protesters or the police) then you should have a chat before the day about what level of risk you are both up for. It's no good charging into the dramatic fight if your buddy is running the other way for their own safety. And the buddy thing goes both ways - look out for your buddy. If either one of you is freaked out and wants to leave (assuming the police allow you) then you should respect your buddy and leave with them.
If things get hectic, particularly in a mobile crowd where some are panicking, then you might want to stay in physical contact - your buddy could rest a hand on your shoulder or upper arm - so you can be confident they are with you even when your eye is glued to the viewfinder. It also means they can get your attention without having to speak to you - it can get very loud inside a big protest, whether due to whistles, chants, samba bands ...
All this is really just general protest advice. As the other answers mention, don't expect to be treated any different if trouble does start. If you're planning to go to a few protests you might want to read a few general guides such as this one pager or this handbook
I'd add that you should expect that in case of an arrest, you could get your material and especially your media confiscated or destroyed. Anti-democratic and possibly against the law, yes. But it can happen, even in western countries. You could also be targeted BECAUSE you're a photographer, especially if you've witnessed situations the police would prefer not to get public.
I know some activists use cell-phones cameras with auto-upload features for that very purpose: the picture and/or video gets backed-up online as soon as it's taken. Slightly paranoid, but keep in mind that they're not there to make art - they're precisely trying to catch scenes of police abuse.
That said, apart from hugely politicized rallies, and events where you know in advance that there's going to be trouble, you shouldn't have to worry about all that. If you keep to the joyful side of the demonstration - the section with drums and oversized papier-maché heads, and families with kids in strollers, and old ladies - you'll never have any problems, and you'll get the best photo opportunities.
If bottles are being thrown, it's not a good idea to wear an ordinary cycle helmet as shards of glass can go through the slots and cause injury. The recommended headgear is a skateboarder's helmet as these don't have slots.
In general though, the Police (in the UK) are increasingly failing to differentiate between protesters and legitimate news-gatherers, and you should adopt the attitude that if you're there, you're a potential target.