Search code examples
phpapache.htaccess

No input file specified -LAMP(Apache)


Anyone can help with my htaccess file, its working with the root domain directory folder only, if i put the index file into the root domain directory and access page like this https://example.com/edr/login , it works nicely . However when i create folder inside it and try to access site like this , https://example.com/createdfolder/edr/login, it says 'No input file exist. Below is my htaaccess file codes. My $_SERVER['QUERY_STRING'] is set to 'login'

Options All -Indexes

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}\.php -f [NC]
RewriteRule ^(.*)$ $1.php [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]

Solution

  • If to copy WordPress' .htaccess it would look like this:

    RewriteEngine On
    RewriteBase /createfolder/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /createfolder/index.php [L]
    

    Of course you can replace createfolder/ with your/path/