EPR Blog

Apr25

Remove index.php from Joomla URL’s

Remove index.php from Joomla URL’s
Print Friendly

I spent hours trying to figure this out and thought I would write about the solution. When turning on Search Engine Friendly URL’s in Joomla, they begin adding an extra index.php within the URL’s so that it looks something like this – http://www.yoursite.com/index.php/category/article.

I want the URL to be http://www.yoursite.com/category/article.

It’s cleaner and better for the search engines.

So, here are the steps I took to remove the unnecessary index.php:

  1. Go to the Global Configuration area within your Joomla admin.
  2. Under SEO Settings, click YES for the following two items:
    1. Search Engine Friendly URLs
    2. Use Apache mod_rewrite (update: In Joomla! 2.5.7, Erik’s step 2. 2. should be “Use URL rewriting”. There is an exclamation icon next to this option. Hover over it to see important instructions like changing the htaccess before clicking on Yes and saving. Thanks Shane Brenizer
  3. Now, go to your htaccess.txt file at the root of your site and rename the file .htaccess.
  4. Use some sort of text editor (I use text wrangler) to remove the ‘#’ before the words ‘RewriteBase / (update: In Joomla! 3.0, you don’t need to take off the ‘#’ sign from htaccess. Just rename the htaccess.txt file to ‘.htaccess’ Thanks Raihan)
    1. For me, this was around line 53 of the .htaccess file.
  5. Now, try to navigate around your Joomla website.  The index.php should be gone.

Blog photo by Needoptic

156 Comments

  1. Remove index.php from Joomla URL's | EPR Creations LLC « php

    […] Pełny artykuł na: Remove index.php from Joomla URL's | EPR Creations LLC […]

  2. MarkSpizer

    great post as usual!

  3. Brian

    WORKS!! a dream after trying other suggestions and the joomla forums nothing worked.

    Thank You.

    Brian

  4. Don Knowlton

    Fantastic! Thank you – btw, I had to change the line to

    RewriteBase /joomla

    as my site is still in a sub-folder – but, works perfectly!

  5. Dawn Smith

    I followed your intstructions to remove the index.php from my url. It shortened the url, but now states that the web page is not found. What can I do to fix this error?

    Thanks.

  6. Erik Rostad

    Hi Dawn – what are your current settings for
    – Use Apache mod_rewrites
    – Add suffix to URL

    Please let me know. That might have something to do with it.

  7. Dawn Smith

    Hey Erik:

    I have both the Apache mod_rewrites and add suffix to url both on yes.

  8. Erik Rostad

    Dawn, please send me an email with your site information so I can take a closer look. You can use the email on my contact page of this website.

  9. ssoso

    finally … great post and thank you

  10. Ravi

    This is great post and help me to solve URL problem

  11. Alex

    This does’t work on godaddy shared hosting. Does anyone know why? Thanks!

  12. Erik Rostad

    Alex – I couldn’t find any posts offering a definitive answer to your question regarding GoDaddy hosting. I have had other issues with GoDaddy hosting and different plugins in the past. I have always had really good luck when I have called the GoDaddy help line. They are usually able to get you an answer or find someone who can help you.

    If they tell you nothing can be done, your other options are to move to dedicated hosting or to a different hosting company.

    Sorry I couldn’t be of more help.

  13. Julia

    Hi Erik! Could y help me? This does’t work for me… I have done everything… I don´t know what is wrong.. can y help me? The site is http://www.verx.com.br
    Tks! regards from BrasiL! =)

  14. Houssam Ballout

    I had did that on my Joomla 1.6, but it didn’t work..
    Any Suggestions?

  15. Erik Rostad

    Hello Houssam,

    I think what you will need to do is to download this extension:

    http://dev.anything-digital.com/Blog/Application-Development/give-your-site-a-seo-kickstart-with-sh404sef.html

    Then, follow these instructions:

    http://forum.joomla.org/viewtopic.php?f=34&t=278999#p1288476

    I believe I had to do this on one site I worked on.

    Please let me know if that works for you.

  16. kurian

    I followed your instructions to remove the index.php from my url. It shortened the url, but now states that the web page is not found. What can I do to fix this error?

    I m using joomla 1.6

    Thanks.

  17. Erik Rostad

    Hello Kurian – what are your current settings for:

    – Use Apache mod_rewrites
    – Add suffix to URL

    If that doesn’t work, then you will likely need to download this extension:

    http://dev.anything-digital.com/Blog/Application-Development/give-your-site-a-seo-kickstart-with-sh404sef.html

    Then, follow these instructions:

    http://forum.joomla.org/viewtopic.php?f=34&t=278999#p1288476

  18. kurian

    Hi Erik,

    These are my settings:

    Use Apache mod_rewrites: yes
    – Add suffix to URL:yes

    when i check on local host , everything work fine but when i move on server side this error has occured.

    “Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.”

    plz help
    Thanx

  19. Erik Rostad

    Hello Kurian,

    If you’d like to send me you login & FTP access info, I can take a closer look. Please use the contact info on this page to send your access information:

    http://www.eprcreations.com/contact/

  20. kurian

    Thanx Erik for your response, I will send you as early as possible. My site is hosted on godaddy, is this a problem?

    plz reply

    Thanx

  21. Mark Ford

    Thanks man. YOU ROCK!!!!!!! I was going crazy trying to figure out what why that was happening!!!

    Thanks SOOOOOOOOOOOO much for posting this!!

    Mark

  22. adrian

    This issue has been causing me major headaches with my hosting company. Thank you for posting this fix it seems to be working great.

  23. Filipe

    Thank you master :D You save my work

  24. Dannysam

    Thanks a ton, this has been very helpful, was beating my head against removing the index.php, finally got it done with your suggestion

    Thanks again.

  25. Mariaria

    Thank you so much. I spent hours trying to figure this out (I have no idea what I’m doing) and you made it crystal clear.

  26. Richard

    How does this work for joomla 2.5 and my root folder is on my computer and the htaccess is not listed as a txt file

  27. Erik Rostad

    Hi Richard, you may need to choose “view hidden files” in your root folder in order to view the htaccess file. I know that some FTP clients will only show the htaccess file if that option is chosen. What FTP client are you using?

  28. edw

    you saved me!!!!
    thanksss!!!

  29. Shonda G

    Well, shucks. It will not let me change the file name from htaccess.txt to .htaaccess because it says the file already exist. I did remove the # from within the file even without the change. index.php still there. suggestions? In the process of finishing up the re-build of our site now so it is largely under construction as far as content as we migrate over to Joomla. http://www.AbundantJourneys.com. Really appreciate your article.

  30. Erik Rostad

    It looks like you got it working. But if not, let me know what you are using to view the .htaccess file. Sometimes you need to choose an option to show hidden files to be able to see the .htaccess file. Once you do that, you can either edit the existing .htaccess file or delete it and replace it with the htaccess.txt file.

  31. Tony

    dude you are a life saver…..Thanks for sharing!!!!!!

  32. Naveed
  33. Bijo

    Hi Erik,
    I have same issue as Kurian’s .
    Can you please advise how the the issue was resolved.
    Or should I need to contact you?

    Am using Joomla! 2.5.4
    Thanks

  34. Erik Rostad

    Hello Bijo – did you try these steps and can you let me know the info below?

    What are your current settings for:

    – Use Apache mod_rewrites
    – Add suffix to URL

    If that doesn’t work, then you will likely need to download this extension:
    http://dev.anything-digital.com/Blog/Application-Development/give-your-site-a-seo-kickstart-with-sh404sef.html

    Then, follow these instructions:
    http://forum.joomla.org/viewtopic.php?f=34&t=278999#p1288476

  35. Brenden

    Great tips! I’m having some issues though. I have two options which I have enabled:

    – Search Engine Friendly URLsYesNo
    – Use URL rewriting

    I renamed my htacces.txt to .htaccess.

    When I mouse-over my links they look perfect. i.e. “http://localhost/mysite/pricing” but when I select the link it leaps me direct to http://localhost/xampp/

    Any clues what might be causing it?

  36. Brenden

    Ignore… silly user :)

  37. Nitin

    thank you !! done for my site without any issue :)

  38. ganesh

    thank you Erik Rostad, you are a genius, it helped me in joomla 2.5

    Regards
    Ganesh

  39. Sarah

    Perfect. Thanks so much for sharing.

  40. Tom Fink

    It worked for me except now how do I get an administrator login? It ignores the /administrator/index.php that I used to get the admin login screen….it may be simple but I have not figured it out yet. Thanks in advance

  41. Erik Rostad

    Hi Tom – give it a try without the index.php, so that the administrator login would simply be http://www.yoursite.com/administrator/. Let me know if that works.

  42. JoomTeach

    Great tips. it help me joomla 2.5.

  43. JoomTeach

    Great tips. it help me joomla 2.5.JoomTech

  44. Paul

    Thanks for the the tip.. I have two sites in shared Linux hosted on go-daddy..

  45. Ian

    Hi. All has worked well, except for the home page. /index.php has been removed from all urls but I can only get to the home page by typing http://www.hampshire-garden-machinery.co.uk/index.php
    What am I missing?
    I’m using Joomla 2.5 installed in public_html folder, which is where the .htaccess file is.
    Thanks

  46. Erik Rostad

    Hello Ian – what are your current settings for:

    – Use Apache mod_rewrites
    – Add suffix to URL

    If that doesn’t work, then you will likely need to download this extension:

    http://dev.anything-digital.com/Blog/Application-Development/give-your-site-a-seo-kickstart-with-sh404sef.html

    Then, follow these instructions:

    http://forum.joomla.org/viewtopic.php?f=34&t=278999#p1288476

  47. Ian

    Hi.
    Search Engine Friendly URLs is set to YES
    Use URL rewriting is set to YES
    Adds Suffix to URL is set to NO
    Unicode Aliases is set to NO
    Thanks.

  48. Erik Rostad

    And did you make the updates to the .htaccess file?

  49. Christian

    Awesome. You save my job!! This also removed index.php on all my images.
    Thank you.

  50. Diego Abner''

    Great Erik Rostad,
    You save my job… Rs
    Thank’s

    Regards!

  51. Mari

    Hi Erick,

    I have:
    SEO Settings
    Search Engine Friendly URLs Yes
    Use URL rewriting Yes
    Adds Suffix to URL Yes

    I changed the
    htaccess.txt file TO .htaccess.
    and removed the #
    the URLS now look great but when I click on each link the page is no longer there, I get

    Not Found
    The requested URL /viruemart-store/recreational.html was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache Server at Port 80

  52. Cynthia Martín

    Hi Erik,

    I already change the global configuration SEO Settings, Search Engine Friendly URLs and Use URL rewriting it´s ON

    Then i edit the htaccess.txt file (the name of the file and the line RewriteBase /) but when i ftp this file my website doesn´t work :(

    Can you help me to figure out what’s happening?

  53. Cynthia Martín

    Erik, i tried for third time and now works!!!! thank you so much

  54. Erik Rostad

    Hi Mari – you shouldn’t have .html at the end of your files as these are not html files within Joomla. Can you try to open the page without the .html at the end of the URL?

  55. Rene Arndt

    Hi Erik,

    I have a problem, pretty much the same as Mari, I set:

    SEO Settings
    Search Engine Friendly URLs Yes
    Use URL rewriting Yes
    Adds Suffix to URL Yes

    I changed the
    htaccess.txt file TO .htaccess.
    and removed the #

    But now my navigation bar is not working any more, I can still access my sites if I add the index.php in between my url and the page name.

    Any idea what I could have missed out on?

  56. Rene Arndt

    Never mind I just found my mistake, I added an extra “.” to .htaccess

    I thought it was part of the code but I just realise it was punctuation on your part.

    Thanks for the great help though!

  57. Johnny B

    Great Article!

    I have a question regarding the google indexation after this URL change.
    Let’s assume my websites were indexed by google like that:
    http://www.some-site.com/
    http://www.some-site.com/index.php/a

    Now, after the change, http://www.some-site.com/index.php/a but also http://www.some-site.com/a is accessible.
    Do I need to remove the URL http://www.some-site.com/index.php/a via the google webmaster tools or will google automatically remove http://www.some-site.com/index.php/a from the index?

    I hope it is precise and clear what i mean.
    Cheers

  58. Johnny B

    Sorry for the double post.
    Well, apparently http://www.some-site.com/index.php/a is NOT accessible any more. It just was in my browsercache.
    So I guess I’ll just have to wait for google to reindex my site and change the URLs?

  59. Johnny B

    OMG!! I’m sorry.
    Please don’t pay attention to my second post. Both URLs are still accessible!

  60. Erik Rostad

    Hi Johnny, do you have a program automatically creating an XML Sitemap on your Joomla site? If so, these should be automatically updated and Google will notice the new URL in your updated XML sitemap file. If you don’t, look for a Google Sitemap add-on to include in your Joomla website.

  61. P Vinnys

    I was scratching my head looking into the PHP code to do this. This tutorial let me keep my hair.. Thank you. I would assume Joomla would make this a bit easier. Nevermind they made everything else easy…..

  62. jen

    Not Found

    The requested URL /general-info/quick-facts.html was not found on this server.
    Whats the problem?i tried the steps but cant open my pages.please help,thanks.im on joomla2.5

  63. Erik Rostad

    Hello Jen – Joomla does not generate .html pages. Try using just /general-info/quick-facts/ at the end of your URL.

  64. blackjack

    Thanks a lot! This works great for me!

  65. Christiaan

    Cool thank you man! Much apppreciated
    http://www.cnmarketing.co.za

  66. meny

    TNX
    it works
    i could spend a lot of time for it.

  67. Tess

    Oh wow.. so simple ;) Thanks for sharing!

  68. Bluebeep

    Wish it was this simple for me. I get a redirect loop showing: Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    All browsers behave just this way.

    There’s something we’re missing here.

  69. Erik Rostad

    Hello Bluebeep – can you please let me know what you added for each portion of the settings listed in this post? I haven’t come across anyone who entered a redirect loop yet after completing these tasks.

  70. Kiera

    Great article, totally what I wanted to find.

  71. Nan

    Thanks so much! This totally fixed my problem! I spent hours on this until the tech support guy at Hot Joomla Templates gave me a link to your article. So simple, but it had stopped me in my tracks!
    Thanks again!!

  72. Thomas de Jong

    Thanks!

    At first I could not get it to work, but after reading the .htaccess file I found the following lines below. By commenting out the “Options +FollowSymLinks” with putting a “#” in front of it, it worked nicely.

    # The line just below this section: ‘Options +FollowSymLinks’ may cause problems
    # with some server configurations. It is required for use of mod_rewrite, but may already
    # be set by your server administrator in a way that dissallows changing it in
    # your .htaccess file. If using it causes your server to error out, comment it out (add # to
    # beginning of line), reload your site in your browser and test your sef url’s. If they work,
    # it has been set by your server administrator and you do not need it set here.
    ##

    ## Can be commented out if causes errors, see notes above.
    Options +FollowSymLinks

  73. Lidia

    It’s not working for me and I don’t know what to do :(

  74. Erik Rostad

    Did the URL change at all? Did you do all of the steps listed?

  75. Oscar

    Thanks for that article!

  76. vishnu

    hi,
    i am getting URL for my articles like this

    http://www.thenandyal.com/videos/item/1091-shakuni-movie-online.html/videos
    i want like this
    http://www.thenandyal.com/videos/shakuni-movie-online
    what to do,to come like that,

    please help me

  77. Erik Rostad

    Have you renamed htaccess.txt to .htaccess?

  78. Adeniji

    Did not work for me
    It keeps redirecting me back to my_site/the menu name but opens in Wamp
    Pls help !

  79. Erik Rostad

    Hello Adeniji – what is the full URL so I can take a look?

  80. Adeniji

    Hello Erik, thanks for your swift response
    Though i have revert back to the original settings since i was finding it hard to get
    Here’s the link…http://demob.atlastechng.com/idcl
    also, what could cause some pages to have date like this (http://demob.atlastechng.com/idcl/index.php/2012-03-14-03-21-37/activation)
    Thanks for lending a helping hand, God bless you real Good !

  81. Erik Rostad

    Hmm, I’d need to take a deeper look to see why you were having the original trouble. It might have something to do with your site being within the /idcl/ folder. For removing the date, here is some information for that – http://www.buildajoomlawebsite.com/forum/how-to-remove-article-dates-in-urls

  82. Adeniji

    I dont understand how to remove the date from url
    Can you help?
    Thanks

  83. Erik Rostad

    Hello Adeniji – can you let me know what part of the instructions where you got lost?

  84. Adeniji

    The Menu type alias is where am having issues
    I have turned on the SEF URLs in global configuration, yet am still getting the same error
    Its a phoca gallery component and some other pages
    Also, if u can look into the index.php removal of a thing or a better tut, i will appreciate it so much
    Thanks !

  85. Erik Rostad

    Were you able to make the updates to the .htaccess file I have written about in this post?

  86. Adeniji

    Yes i Made the changes to the .htaccess and also enable SEF url, so when ever i click on any menu, it gives me a 404 error page
    WHat else can be done?

  87. Abrūsas

    Thnak You very much!

  88. Simon

    Worked a dream for me, but matey above is correct with this line in the .htaccess file.

    ## Can be commented out if causes errors, see notes above.
    Options +FollowSymLinks

    Have to edit it to read

    ## Can be commented out if causes errors, see notes above.
    # Options +FollowSymLinks

    Don’t need to do this on all servers but its worth looking at if you get error pages.

    Thanks loads for your help :)

  89. Russell

    Hello,

    I’ve been racking my brains out getting this to work. I’ve got it to work on other sites, but this particular one is giving me a problem. Would it be because I need to restart the Apache service? I would really appreciate some help with this.

  90. Erik Rostad

    Hi Russell – can you advise the domain name? Have you completed all steps listed in this post?

  91. Russell

    I did follow all the steps.

  92. Erik Rostad

    Hello Russell – I think what you will need to do is to download this extension:
    http://dev.anything-digital.com/Blog/Application-Development/give-your-site-a-seo-kickstart-with-sh404sef.html

    Then, follow these instructions:
    http://forum.joomla.org/viewtopic.php?f=34&t=278999#p1288476

    Please let me know if that works for you.

  93. Wouter S

    Erik you are a hero. Without your help I could not have fixed this!!
    First I followed your steps, but the error remained showing up. So I contacted my webhost for their help, and it seems I had to synchronize my .htaccess (with the ‘#’ removed in this file) to their server with a special button on their site.
    After I did this, all my urls work proper. Thanks!

  94. Shane Brenizer

    In Joomla! 2.5.7, Erik’s step 2. 2. should be “Use URL rewriting”. There is an exclamation icon next to this option. Hover over it to see important instructions like changing the htaccess before clicking on Yes and saving. Thanks Erik for your help!

  95. Erik Rostad

    Thank you Shane – I have made this update in the post (and credited you as well).

  96. K.O.D

    I have tried everything possible i saw on the internet it does NOT work…Finally i give up :( because i think its dependent on your theme or template being used. Current Setting

    URL rewriting = Yes
    Search Engine Friendly URLs = Yes
    Renamed htaccess to .htaccess
    Removed the “#” infront of RewriteBase /
    added a # before ‘Options +FollowSymLinks’

    i have tried everything Finally I Give up… Im tired of this whole thing :(

  97. K.O.D

    i am Honestly Heartbroken that i cant find a solution to this

  98. Erik Rostad

    Hello KOD, have you looked through the comments to this blog? Many people have also had trouble after instituting the updates and so some additional options are suggested within these comments. Please take a look and see if any of those help out. Please let us know how it goes.

  99. Adeniji

    Hello Erik, you have been doing a nice job. Please i’d suggest if anybody can upload the .htaccess they used for removing the index.php, It will save some people their jobs and stress.
    Just a suggestion because i have tried all solutions and they seems not working, am even tired but hate seeing the index.php on my clients site, please help !!!

  100. Erik Rostad

    Hello Adeniji – it’s just the .htaccess file that comes with the Joomla installation (http://www.joomla.org/download.html). On line #53 or around that area, there is a line that says:

    # RewriteBase /

    Just simply remove the # before the words by deleting it. That will leave RewriteBase / and will call the feature that removes /index.php/ from the URL.

  101. Adeniji

    I did that and it worked on the condition of a mouse over, when i refreshed, i had a 404 error page
    Am just tired of dis..
    Wish i could see an expert to put me through

  102. Angelo

    I have tried everything on here letter for letter. I can’t get it to work on another forum I found that if the site is hosted locally SEO wont work. Is this the case?

    Any guidance would be great.

    Thanks

  103. Erik Rostad

    Hi Angelo, not sure what to tell you there. Sorry.

  104. Raihan

    Wow! I spend nearly 6 hours behind that. At the end I asked to my hosting people. They even can’t solve. It’s so easy.
    Just to mention, for Joomla 3.0 – you don’t even need to take off ‘#’ sign from htaccess. Nothing at all inside htaccess.txt file, but rename it only as ‘.htaccess’. That’s it.
    Thanx a lot.

  105. Erik Rostad

    Thanks for the info Raihan.

  106. Tommy

    I followed up your instruction but get error message Internal Server Error. I’m using wamp server on localhost.
    I changed these in the httpd.conf file of Apache*:

    Options FollowSymLinks
    *AllowOverride All
    Order deny,allow
    Deny from all

  107. Erik Rostad

    Hello Tommy – the wamp server might be your problem. Joomla is Linux-based and you appear to be using Windows hosting.

  108. Al.

    Hi, This method works great However, the pages connected to each tab wouldn’t display the content once completed the above instructions. I’m guessing it has something to do with renaming the links, can any body confirm this?

    Many thanks.

  109. Russell

    I followed the steps and index.php is gone, but none of my links to other pages work. Most notably in the top navigational menu. What’s the fix for this?

  110. Adeniji

    Hello Erik and Fellow Gurus in the house, please i really need your help in solving this issue. I have some List (li) items and i want the the drop down to align to the left for some elements and some should remain.
    Actually, this is the link http://www.atlastechng.com/demo/new/tellme/
    When u Hover the More, Opinion and Lifestyle Menu link, it aligns to the right and out of the page causing a lengthy stuff, i want only those 3 Menu List to align to the left when a mouse hovers on it.while others remain. I hope you guys understand me.I have come across a nth element in css somewhere but cant remember..
    Please guys, what can i do to achieve this? if u can also recommend me to another site, i will appreciate that as well.
    Hoping to read from you soonest !

  111. Erik Rostad

    Hi Russell – what version of Joomla do you have installed for the website?

  112. Russell

    I’m using 2.5.9

  113. Han Koster

    I had no success with this tip, until I realized that my site was not in the root of the url.
    So I had to change the rewrite rule to:
    Rewritebase /sitefolder

  114. Erik Rostad

    Hi Han – thanks for the tip.

  115. Erik Rostad

    Hmm, not sure what to tell you Russell. I know with other CMS programs, once I make a change like that, I need to reset the permalinks or menu option so that the new menu URL’s are reset. I know many other people have followed the instructions listed above and everything has worked accordingly. You were able to make the update to the .htaccess file, correct?

  116. Russell

    Yes, I followed all the instructions and it works on all my other sites except for one. Maybe Han’s suggestion will work.

  117. Erik Rostad

    Ok – let us know how it goes. If that doesn’t work, let us know and we’ll see what else we can try. Also, since it is a University website, it could have something to do with the University’s server setup. I know I’ve worked on University sites in which the servers have functioned differently to what I was used to with other hosting options.

  118. Tom

    Tnx for the easy step by step solution :) works very well :)

  119. Gary

    Thanks for all the tips Erik, but I still can’t get the url rewriting to work properly.

    I’ve taken all the measures listed, and the url rewriting works on the menu if I hover over it, but I get an error message:
    “Forbidden: You don’t have permission to access /index.php on this server.” on any page I try to access.

    If I manually insert index.php in the appropriate place, I can access the page/menu item.
    I figured that the menu links aren’t getting rewritten, and on the ‘Edit Menu Item’ page under Details, the page link is listed as index.php?option=com_content&view=article&id=xxxx

    Even if I create a new menu item, or copy the item, I still can’t access it from the menu, I get the same error message.

    Apparently the site is hosted on an Apache/2.4.4 (Unix) Server. I’m using Joomla 3.0.3.

    Is there anything else I can try? I have another site on (I think) the same server that is rewriting URLs just fine, but that’s running Joomla 2.5.8

  120. Erik Rostad

    Hmm, I think you are right that for some reason the pages are not getting re-written. Here is a post I came across the specifically deals with Joomla 3.0. Can you try this and let me know if that helps? http://www.inmotionhosting.com/support/edu/joomla-3/seo-settings/remove-index-php

  121. Gary

    Erik, thanks for your prompt reply. This was the first method I tried. I’m not sure how it differs from your method, it looks exactly the same to me.
    Essentially, I renamed htaccess.txt to .htaccess, then switched URL Rewriting and SEF URLs to YES.
    I’ve even removed the # before RewriteBase / even though it’s supposedly not necessary in Joomla 3.0.
    I asked my hosting provider, he told me not to use Joomla 3.x as it’s not stable. Which quite frankly is nonsense, unless Joomla broke something in the 3.0.3 release.
    This is an incredibly frustrating problem.

  122. Erik Rostad

    Hi Gary – yeah, I can’t help you with Joomla 3.0. I’ve pretty much moved everything over to WordPress so I am no longer using Joomla for my sites.

  123. Burak

    Hello I followed exactl the instruction and the url changes but when click some other menu site I got a 404 error. Can I do something else? I tried also to edit the .htaccess with different code but no solution. I habe a strato server and ai think I do have mod_rewrite. What can I do?

  124. Erik Rostad

    Hello Burak – what version of Joomla are you using?

  125. Piseth

    Very thank
    .
    Well done

    It most usefully.

  126. Piseth

    I use 2.5 it very good .

  127. Duc Nguyen

    Dear ERIK ROSTAD,
    Plese help me. I remove success index.php in URL. But when i access mydomain.com/index.php system not redirect domain.com.
    Please guide me write file htaccess.

  128. Erik Rostad

    Hi Duc – what version of Joomla are you using?

  129. Abbie P

    I am a newbie with Joomla and its been causing me a headache how to remove index.php until I came to your site. Thankyou so much for sharing this. works like a charm for me :)

  130. Discognate

    thank u loads, u dear good soul!

  131. Seby

    I have changed the file to .htaccess and it say server mismatch.. Below is my htaccess file. Kindly Check..

    ##
    # @package Joomla
    # @copyright Copyright (C) 2005 – 2013 Open Source Matters. All rights reserved.
    # @license GNU General Public License version 2 or later; see LICENSE.txt
    ##

    ##
    # READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
    #
    # The line just below this section: ‘Options +FollowSymLinks’ may cause problems
    # with some server configurations. It is required for use of mod_rewrite, but may already
    # be set by your server administrator in a way that dissallows changing it in
    # your .htaccess file. If using it causes your server to error out, comment it out (add # to
    # beginning of line), reload your site in your browser and test your sef url’s. If they work,
    # it has been set by your server administrator and you do not need it set here.
    ##

    ## Can be commented out if causes errors, see notes above.
    Options +FollowSymLinks

    ## Mod_rewrite in use.

    RewriteEngine On

    ## Begin – Rewrite rules to block out some common exploits.
    # If you experience problems on your site block out the operations listed below
    # This attempts to block the most common type of exploit `attempts` to Joomla!
    #
    # Block out any script trying to base64_encode data within the URL.
    RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
    # Block out any script that includes a tag in URL.
    RewriteCond %{QUERY_STRING} (|%3E) [NC,OR]
    # Block out any script trying to set a PHP GLOBALS variable via URL.
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    # Block out any script trying to modify a _REQUEST variable via URL.
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    # Return 403 Forbidden header and show the content of the root homepage
    RewriteRule .* index.php [F]
    #
    ## End – Rewrite rules to block out some common exploits.

    ## Begin – Custom redirects
    #
    # If you need to redirect some pages, or set a canonical non-www to
    # www redirect (or vice versa), place that code here. Ensure those
    # redirects use the correct RewriteRule syntax and the [R=301,L] flags.
    #
    ## End – Custom redirects

    ##
    # Uncomment following line if your webserver’s URL
    # is not directly related to physical file paths.
    # Update Your Joomla! Directory (just / for root).
    ##

    RewriteBase / Floorit

    ## Begin – Joomla! core SEF Section.
    #
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    #
    # If the requested path and file is not /index.php and the request
    # has not already been internally rewritten to the index.php script
    RewriteCond %{REQUEST_URI} !^/index\.php
    # and the request is for something within the component folder,
    # or for the site root, or for an extensionless URL, or the
    # requested URL ends with one of the listed extensions
    RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
    # and the requested path and file doesn’t directly match a physical file
    RewriteCond %{REQUEST_FILENAME} !-f
    # and the requested path and file doesn’t directly match a physical folder
    RewriteCond %{REQUEST_FILENAME} !-d
    # internally rewrite the request to the index.php script
    RewriteRule .* index.php [L]
    #
    ## End – Joomla! core SEF Section.

  132. Erik Rostad

    Hi Seby – what version of Joomla are you using?

  133. Taner

    Hi Im using joomla 3.1.1 and have a multi-language but am getting error 500 when I Use URL rewriting. Any ideas?

  134. Erik Rostad

    Hi Taner, no, sorry, don’t have any ideas. Just to verify – you did all of the steps listed in this post, correct? There is a note in the instructions that is specific to Joomla 3. Some things may have changed in Joomla 3+ since the writing of my post.

  135. Nait

    Works perfectly! Thank you!

  136. Paul

    This works great! Thanks much.

  137. omarodoch

    My god, thanks, you are truly a genius!

  138. Joenineo

    I had loads of problems using the simple steps of converting htaccess.txt to .htacccess, Internal server error 500, and found that I needed to install the rewrite mod in apache, then doing the simple steps it worked first time!!!

    Hope this helps someone

  139. Rick

    Thanks. Of all the sites I visited to solve this problem, you offered the most simple solution that actually worked.

  140. Amid

    It didn’t work for me. I had the name of the file changed in FTP and it disappeared. I also tried removing the # from the file and over-writing the missing file (which apparently went hidden) and my webpages (other than home) crashed. So i simply tried putting the index.php into the URL to see whether my pages were still functional on the index.php’s and surprise! They were there.

    I’m using Joomla 3.1. Looking forward to hear back from someone for a solution! That index.php is really not good looking.

  141. Erik Rostad

    Hello Amid, what FTP client are you using? You will need to choose an option to ‘View all Files’ in order to view the .htaccess file again. When you start off a file with a period (.hatacces), the file does not show unless you choose Show All Files. Please let me know if that works for you and allows you to get back into that file.

  142. Roberto

    Awesome!

  143. Matt

    Hi,
    I’ve tried this but I’m not seeing any difference… Anything else I need to check?

    Thanks
    Matt

  144. Erik Rostad

    Hi Matt – What version of Joomla are you using? Have a look at some of the comments below my blog post as many additional questions have also been answered there. Regards.

  145. Debbra

    I almost never leave comments, but after reading through a few of the comments on
    Remove index.php from Joomla URL

  146. Aracelis

    This article is truly a nice one it helps new the web visitors who are wishing for blogging.

  147. Brenna

    This is really the 4th article, of your site I personally read.
    Nonetheless I personally enjoy this particular 1, “Remove index.
    php from Joomla URL

  148. Olimpia

    Thank you! I’ve spent so much time to change it too.. until I’ve found your site and solution! THANKS!

  149. lina

    Amazing! Thanks!!!

  150. Roman

    Hi,
    i am using the latest joomla 3.x
    I changed htaccess.txt to .htaccess.txt
    I enabled Use URL rewriting in global config in admin panel.

    Now, I can see that it removed index.php from url but now it wont show me the sites – I am getting errors all the time:

    Not Found
    The requested URL /component/users/ was not found on this server.

  151. Erik Rostad

    Hi Roman, you need to change .htaccess.txt to .htaccess without the.txt. Did you do that?

  152. Roman

    Hi Erik,

    Yes, I tryed that but when I do that I get this error:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, support@one.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

  153. Roman

    ok i found it out. Its working now!

    solution is rename to .htaccess (without .txt)
    and comment that line!

    I had to comment this line with #
    #Options +FollowSymLinks

  154. Teo

    Thanks!

  155. cyo

    In the root folder, when I try to rename the htaccess.text file to .htaccess, it tells me the file already exists.

  156. Erik Rostad

    Hello Cyo – ok, are you able to view your current .htaccess file to see what is in it?

Leave a Comment

Your email address will not be published. Required fields are marked *