SEO Help please, with link going to correct SEO path

I need som SEO help here, I am using joomla with custom coded added.

But when we trun on our SEO feature everything is good, but our links are not going to the correct path.



Here is an example of NON-SEO link
http://site.com/index.php?option=com_community&view=profile&userid=userid&Itemid=100


When we turn on SEO

The link is
http://site.com/community/65-sexyapp/photos


But we need it to REad
http://site.com/components/community/userid-username/photos


We’ve tried

Redirect /community/$1/photos /component/community/$1/photos
DOES NOT WORK

WE’ve also Tried
RewriteRule ^component/([a-zA-Z0-9_-]+)/$1-$2/([0-9]+)\ http://site.com/index.php?option=com_community&view=profile&userid=$1&Itemid=$ [NC]

Still nothing works, it just remains to the default, SEO change that is not correct, please HELP

Dan,

What you REALLY need is help with mod_rewrite. However, what you’re attempting needs to be “mapped” and you’ve not made it easy (changing Itemid numbers et al). If you have a look at the tutorial linked in my signature, you’ll understand why.

Comments on your code:

Target = http://site.com/index.php?option=com_community&view=profile&userid=userid&Itemid=100

URL = http://site.com/community/65-sexyapp/photos

How do you get com_community from community, where does profile come from, is 65 the userid and where does sexyapp/photos get redirected to?

No, actually, you need it to read com_community (components/community), you should hide userid- rather than identify the key for username and, again, where does photos tell Apache how to get Itemid=100?

ARGH!

You cannot put $1 or $2 in the regex of a RewriteRule and your \ is escaping a space which is not allowed (outside a character range definition. You DID get the position of the hyphen correct in your first character range definition, though, so you’re ahead of many mod_rewrite newbies.

The redirection doesn’t need to be external (http://site.com/) but the Itemid’s value is missing. Further, the No Case flag is inappropriate for a RewriteRule (because the {REQUEST_URI} string is case sensitive … and you’ve used [a-zA-Z] which is the correct way to deal with that).

WARNING: CMS’s create their own mod_rewrite and use modules to reformat your links so the modules can read them and fetch the correct record(s) from your database. Messing around with mod_rewrite will change this and likely collapse your CMS website … if you’re not both knowledgeable and very careful.

Regards,

DK