Home > front end >  cannot access url string something missing on my code?
cannot access url string something missing on my code?

Time:10-24

I have a problem with apache giving me a "not found" error.

scenario:

I have a url of the form --> 10.17.10.19/webapps/api/index.php?url=auth

I want to rewrite the url in the form --> 10.17.10.19/webapps/api/auth

im Using Ubuntu 20.04 apache2

vhost:

      <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/
<Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
            Order allow,deny
            allow from all
</Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

htaccess:

RewriteEngine On
Options All -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

apache.conf

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

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

#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>

Please help me to correct the condition to recognize the parameter

CodePudding user response:

i found the answer i need to enable header so the htaccess can work

ae2enmod header

https://httpd.apache.org/docs/2.4/mod/

  • Related