Why the url request cannot be found in server?

Posted May 18, 2017 5.2k views
ApacheAPIUbuntu 16.04

I done creating my own API,and host it to Ubuntu 16.04.I created the phpmyadmin with Php One click install.

Done this 2 line of command in digital ocean console

 sudo a2enmod rewrite
 sudo service apache2 restart

I have my own .htaccess file which is like below

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]

And I transferred my file to /var/www/html this directory.

I edit the apache2.config as well like below as well

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

But when I call my api in Postman it show me this result it state url not found.I request my address as http://MY_IP_ADDRESS/example/v1/register ,I am sure is correct URL.

Somebody please tell me what can I do to solve this problem.What am I missing out??

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


What you’d use really depends on how your application is setup to handle requests to index.php.

You may be able to use something such as:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [NC,L,QSA]


RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [NC,L,QSA]
  • Sir when I tried what you suggest it give me this error when I call the url

    It show this in Postman,can u give me another suggestion?cause I very new in server code


    PHP 5
    Apache 2.4
    MySQL 5
    Version 3.0.6 - 64bit

    Server Configuration

    Apache Version:
    2.4.23 - Documentation
    PHP Version:
    5.6.25 - Documentation
    Server Software:
    Apache/2.4.23 (Win64) PHP/5.6.25 - Port defined for Apache: 80
    Loaded Extensions :

  • or what setting i’m setting wrong?so I can configure out.