rewrite is not working in virtual host
Posted by: manashb (111.125.230.---)
Date: December 12, 2019 06:18PM

Version 3.1.9 - 64bit

Virtual host config -

<VirtualHost *:80>
    ServerName emp.lcl
    DocumentRoot "c:/wamp64/www/emp"
    <Directory  "c:/wamp64/www/emp/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
        RewriteEngine on
        RewriteRule "^/api/employee/search/(.*)$" "/api/employee.py"
    </Directory>
</VirtualHost>

Virtual Host is working fine. When i am trying to access the url instead of redirecting it is showing me below 404 error

The requested URL /api/employee/search was not found on this server.



Edited 1 time(s). Last edit at 12/14/2019 02:13PM by RiggsFolly.

Options: ReplyQuote
Re: rewrite is not working in virtual host
Posted by: Otomatic (Moderator)
Date: December 12, 2019 07:19PM

Hi,

Are you sure that your rewriting rules should be in the Directory structure?
Check it by deleting the VirtualHost rules and putting them in an.htaccess file with the same rules in the c:/wamp64/www/emp/
RTFM

However, it has absolutely nothing to do with how Wampserver works. This forum is not intended to debug PHP scripts or SQL queries or Apache rewriting rules.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.