Take the 2-minute tour ×
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It's 100% free, no registration required.

I was wondering if it is possible to remove the 'index' that is shown in every URL.

share|improve this question

4 Answers 4

You can do that by enabling the SEF URLs and especially the parameter "Use URL rewriting" in the Joomla global configuration.

Please note that this will generate an internal server error if you didn't create the .htaccess file before enabling the option.

There is a doc page explaining what steps are needed to get those nice URLs. Have a look here: http://docs.joomla.org/Enabling_Search_Engine_Friendly_(SEF)_URLs

Basically you have to rename the htaccess.txt file found in your Joomla root directory. Depending on your hoster, additional steps are needed.

share|improve this answer
    
OK, I will give that a try. It's a bit weird that Joomla doesn't generate that code itself as now I think about it. I think I tried that option and it did in fact crash. –  connersz May 12 at 8:09
1  
That's exactly the reason why Joomla doesn't generate the code itself. It depends a lot on the host and we don't want to completely break your site by enabling a feature :) –  Bakual May 12 at 12:48

You could add this code to the top of Joomla's index.php:

if(strcmp($_SERVER['REQUEST_URI'], '/index.php') == 0 && $_SERVER['QUERY_STRING'] == ''){
    header("HTTP/1.1 301 Moved Permanently");
    header('Location: /');
    exit;
}

Be careful though, if you take this approach, you'll need to redo this when you upgrade.

share|improve this answer
    
I'd suggest you could do this as an optional hack if the redirect and ReWrite did not work in htaccess. So a valid fall back –  tristanbailey May 9 at 1:08
    
agreed. that's actually how we got to this solution. We couldn't get the htaccess fix to work properly site wide –  ContextSwitch May 9 at 12:57

Here is a general method if your site crashes using .htaccess:

  • You should comment one or both of these lines:

Options +FollowSymLinks

and/or,

RewriteBase /

This should work fine! Note: you do commenting by giving a hashtag for a line "#"

share|improve this answer
  1. Changed htaccess.txt to .htaccess
  2. Site > Global Configuration : Use URL rewriting (Choose Yes)
  3. SEO Settings Search Engine Friendly URLs(Choose Yes)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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