Forums » Question about the .htaccess file and index.php

RSS feed for this topic

Info

  1. I've installed Omeka - runs fine, however, I must explicitly type in 'omeka/index.php' to start -- the .htaccess file doesn't include anything to redirect the usual index.htm -- what can I do to make it easier to access the site?

  2. Especially if you are on a hosted server, it might be worth double-checking that Omeka's .htaccess was successfully copied. My first guess is that a default .htaccess file on the server is there, not Omeka's

  3. Appreciate your response, but it is definitely 'there' in the omeka directory. I added the following line, which I thought would work (but it had no apparent effect):

    DirectoryIndex index.php index.html

    I can definitely open the site, but I have to explicitly type the URL as http://www.mysite/omeka/index.php (and the admin page as "www.mysite/omeka/admin/index.php)

    But...shouldn't the 'DirectoryIndex' line work???

  4. If this is what's there in the .htaccess file, it might be that the server doesn't have the rewrite module installed. That'd be a question for the hosting provider or sysadmin.

    You might also try the suggestion in the comments of the .htaccess file, just below RewriteEngine on, about setting the RewriteBase

    # Remember to enable display_errors on development environments only.
    
    <IfModule mod_php5.c>
        php_value display_errors 0
        php_flag register_globals off
    </IfModule>
    
    RewriteEngine on
    
    # If know that mod_rewrite is enabled, but you are still getting mod_rewrite errors,
    # uncomment the line below and replace "/" with your base directory.
    # RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^admin/ - [C]
    RewriteRule .* admin/index.php [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* index.php
    
    <FilesMatch "\.(php|ini)$">
     Order Allow,Deny
     Deny from all
    </FilesMatch>
    
    <Files index.php>
    Allow from all
    </Files>
    
    # Uncomment the lines below in order to enable caching of some files via Apache (after a finished site has gone live)
    <IfModule mod_expires.c>
    #  <FilesMatch "\.(js|ico|gif|jpg|png|css)$">
    #       ExpiresActive on
    #       ExpiresDefault "access plus 10 day"
    #   </FilesMatch>
    </IfModule>
  5. Did some google searching and found the following on this site:
    http://corz.org/serv/tricks/htaccess2.php

    1. you only need to do this once per .htaccess file: Options +FollowSymlinks
    RewriteEngine on

    2. RewriteRule ^(.*)\.htm$ $1.php [NC]

    Now I no longer need to explicitly type in the 'index.php'

  6. Great! Glad that works now!

Reply

You must log in to post.