Help htaccess rule

Hi to the forum and sorry for my english! :x
I develop a web portal using cms joomla, now my url il like this :

mysite.com/component/estateagent/azienda/rest_of_the_url

i would like to hide the part component/estateagent and get url like this :

mysite.com/azienda/rest_of_the_url

is possibile? i really hope in your help…i can offer two link rank 4 to my helper!! :lol:

thanks so mucj,
Riccardo from Italy

coc,

First, WELCOME to SitePoint’s Apache forum!

WARNING: It’s dangerous to mess with a CMS’s mod_rewrite as it’s tied into the module which reads and parses the URI to fetch the correct modules and data for the visitor.

Okay, it IS possible but dangerous. IMHO, what you need to do is the “loopy” redirection which is discussed as an example near the end of my signature’s tutorial. Use the {IS_SUBREQ} version and be sure that you’re redirecting away from component/estateagent with an R=301 then redirecting back WITHOUT the R=301 (so Joomla can serve the correct file).

Regards,

DK

thanks so much…but i dont find the example…can you help me?

i want to change component/estateagent into case/

thanks so much
Riccardo

coc,

# Assumes "usable link" is index.php?id=alpha
# and alpha is the extensionless link
# Redirect to NEW format
RewriteCond %{IS_SUBREQ} false
RewriteCond %{QUERY_STRING} id=([a-zA-Z]+)
RewriteRule ^index\\.php$ %1? [R=301,L]

# Redirect back to "usable link"
RewriteRule ^([a-zA-Z]+)$ index.php? id=$1 [L]

I’ll let you add the case directory to this with the reminder that “case/” is the NEW format while “component/estateagent/” is the serve-able format.

Regards,

DK