1

I'm having problem with a .htaccess file removing request.php from URL. My htaccess file is

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # deal with php5-cgi first
    <IfModule mod_fcgid.c>
        RewriteRule ^(.*)$ request.php?/$1 [QSA,L]
    </IfModule>

    <IfModule !mod_fcgid.c>
        # for normal Apache installations
        <IfModule mod_php5.c>
            RewriteRule ^(.*)$ request.php/$1 [L]
        </IfModule>
        # for Apache FGCI installations
        <IfModule !mod_php5.c>
            RewriteRule ^(.*)$ request.php?/$1 [QSA,L]
        </IfModule>
    </IfModule>
</IfModule>

The htaccess file (and all files) is located at localhost/firstDirectory/secondDirectory/

When I try to access to request.php from

http://localhost/firstDirectory/secondDirectory/some/value

works fine, but when I try from

http://mydomain.com/theapp/some/value

it doesn't works. In this case htaccess file is located at /var/www/theapp and theapp is a symbolic link to /mnt/data/theapp

Why at local server works but not in the remote server? htaccess file must be placed at another location? like document root for example?

1
  • Are there any other differences between these servers besides the file path? Particularly in the rest of the Apache configuration. You could be missing mod_rewrite or not have a RewriteEngine on clause or not have AllowOverride switched on or something else entirely. Do a diff on each of the files to find the difference and then add it to your question.
    – Ladadadada
    Jul 31, 2013 at 8:03

0

You must log in to answer this question.

Browse other questions tagged .