0

I developed a Joomla website which is like a directory. People have their profile in the site and I created a component called com_profile to display their profile when passing the id. So for the following URL it is displaying the profile now.

http:///index.php?option=com_profile&id=100

I need to change the url so when a user type like this "http:///service_providers/100" it will show the profile.

How can I do this? I tried different ways in htaccess nothing helped. :(

Sudharshan R
  • 106
  • 1
  • 4

1 Answers1

0

Add this to your apache configuration or htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^service_providers/([a-zA-Z0-9-z\-]+)$ index.php?option=com_profile&id=$1

Make sure that modrewrite is enabled. If it's not, enable it via cli by typing a2en modrewrite

IAteYourKitten
  • 968
  • 1
  • 6
  • 13
  • Thanks. But it is not working. Previously when I type the url it went to 404 page but now it is not going to 404. But displaying the home page. I typed this url /service_providers/193. It shows the home page still. When I type /option=com_profile&id=193 it is showing the correct profile. – Sudharshan R Feb 21 '15 at 04:14
  • 1
    Sorry. It seems working. I think some resrictions in my component redirecting back to home page. Thanks a lot. I will check and fix it. – Sudharshan R Feb 21 '15 at 04:22