How do I show titles of the page in URLs?

Currently: http://websitename.com/index.php?c_id=18&start=0&m_id=1

Change To: http://websitename.com/index.php?c_id=title_of_the_page&start=0&m_id=1

Like Joomla gives us option to change URLs to seo-friendly, is there a code or something we do in httaccess etc so the page title automatically becomes part of the URL?

  • Why not use WordPress which is excellent SEO capabilities built in or Yoast SEO which make it even better?
    – Anagio
    Commented Apr 30, 2012 at 11:03

3 Answers 3


Your question has different answers for different versions of Joomla. First I recommend on reading this.

I work with Joomla 1.5 in the following manner:

but I think it's a better practice to get rid of the "index.php" part of the URL (I didn't have time to implement it in my own website). That said, you don't have to "do it yourself" - as you can use plugins such as this one.


As you're using the title could be anything, and isn't really known until the page id displayed, by which time the URL has been used.

So this only works if you know the code used to generate the title in the PHP file. You could use similar code to that to generate the htaccess rules which convert the cryptic URL to a URL with the title in it.


Yes, what you're looking for is the Mod_rewrite module for apache2. You may well already have this modules active on your server especially if your using a shared hosting package.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html explaines its usage.

In essance, you place your 'url rules' in your .htaccess file in your web root.

For example, a .htaccess file might contain:

RewriteEngine On RewriteRule ^index.html$ newsite.html

would direct a index.htlm request to newsite.html.

  • note- your main apache2 config file should contain the "AllowOveride" directive in order for you to use .htaccess files.
    – user885983
    Commented Apr 30, 2012 at 11:27
  • What's the rule to examine the contents of the page to extract the title tag and change the URL? The questioner is asking a very specific question, not a general question about rewriting URLs. Commented Apr 30, 2012 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.