apache - url rewrite rules not applying to sub-directory files -


am creating site admin side , trying write general .htacess handle rewrites site , stored @ root of site. problem having rewrite rules applying files @ root files under admin directory don't work.

here contents of .htaccess file:

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /  # add trailing slash /admin rewritecond %{request_uri} ^.*/admin$ rewriterule ^(.+)$ $1/ [r=301,l]  rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule . - [l]  rewriterule ^([a-z_]+)/?$ $1.php [nc,l] rewriterule ^([a-z_]+)/([a-z_]+)/?$ $1.php?$2 [nc,l] rewriterule ^([a-z_]+)/([a-z_]+)/([0-9]+)/?$ /$1.php?$2=$3 [nc,l] </ifmodule> 

when try access file under under admin directory example typing http://my_site/admin/test receive 404 error , nothing displayed yet file exists when access admin root http://my_site/admin/ able see default index.php file in directory.

herer of content /var/log/apache2/error.log after running command less error.log | tail on it

[tue jul 25 15:58:17.825903 2017] [:error] [pid 12073] [client 127.0.0.1:57190] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:05:42.217387 2017] [:error] [pid 12078] [client 127.0.0.1:57532] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:06:11.009051 2017] [:error] [pid 12073] [client 127.0.0.1:57548] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:06:11.725787 2017] [:error] [pid 12073] [client 127.0.0.1:57548] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:06:12.367094 2017] [:error] [pid 12073] [client 127.0.0.1:57548] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:06:37.558746 2017] [:error] [pid 12078] [client 127.0.0.1:57566] script '/var/www/elite/admin.php' not found or unable stat [tue jul 25 16:06:57.091129 2017] [:error] [pid 6310] [client 127.0.0.1:57572] script '/var/www/elite/admin.php' not found or unable stat 

am running apache/2.4.18 (ubuntu).

how can issue resolved? thank you.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -