1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Apache rewrite - How do I include index.php using Joomla?

Discussion in 'Apache' started by Beefandy, Feb 11, 2010.

  1. #1
    Hi basically my joomla site decided to throw a wobbler yesterday, I was getting a 404 page from nowhere.

    I was told that to fix the error I had to use apache rewrite and change a folder to .htaccess then select the option in joomla config.

    It fixed the problem but the url has changed slightly, now all indexed urls are different. With it being a news site this is a problem.

    For example its gone from:

    http://www.release-news.com/index.p...work-introduced-could-it-be-the-next-facebook

    to


    http://www.release-news.com/society...work-introduced-could-it-be-the-next-facebook

    Basically i want to know how i can make it rewrite but with the /index.php in the URL

    Thanks
     
    Beefandy, Feb 11, 2010 IP
  2. fourdesign

    fourdesign Member

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #2
    Yeah you should be able to do this...

    First off, unless you change the "index" page in the htaccess file you do not need to reference an index.php file. No matter what directory you use the index.php or index.html file is the default. For instance, if you type in

    www.mysite.com

    the apache/iis should automatically point to www.mysite.com/index.php or www.mysite.com/index.html. This also works for subdirectories:

    www.mysite.com/news/ will automatically point to www.mysite.com/news/index.php

    Second, I am not exactly sure what your directory structure is by your post. If you want the index.php in the url then in the rewrite rule you would include it:

    RewriteRule ^index\.php/([A-Za-z0-9-\.]+)$ yoururl.php?myid=$1 [L]

    I think this should work and I will try my best to explain it. Basically, you are telling the rewrite engine to look for the address www.mysite.com/index.php/title-of-my-page and rewrite that to www.mysite.com/index.php/yoururl.php?myid=title-of-my-page

    Is this what you were looking for?
     
    fourdesign, Feb 13, 2010 IP
  3. fourdesign

    fourdesign Member

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    Actually I might have mistyped this, try:

    RewriteRule ^index\.php/([A-Za-z0-9-\.]+)/?$ yoururl.php?myid=$1 [L]
     
    fourdesign, Feb 13, 2010 IP