mod_rewrite not working xampp (with picture)

20,903

Solution 1

You want:

RewriteRule ^xampp/test/dra/?$ /xampp/test/draft.php [NC,L]

Or simply:

RewriteRule dra/?$ /xampp/test/draft.php  [NC,L]

The RewriteRule takes from what comes after domain/ in your case it would what comes after http://127.0.0.1/ or http://localhost/.

Also this rule is not to change your draft.php, this rule you have is to allow you to access:

http://localhost/xampp/test/dra/

And have your draft.php serve it without showing it.

Solution 2

In httpd-xammp.conf

transform

Allowoverride AuthConfig to Allowoverride All

I think it will help you

Share:
20,903
Anonymous
Author by

Anonymous

When the people fear their government, there is tyranny; when the government fears the people, there is liberty.

Updated on July 09, 2022

Comments

  • Anonymous
    Anonymous almost 2 years

    I've look through the tutorials in web, and below is what I had done to test if mod_rewrite work.

    First: Uncomment the mod_rewrite.so(@httpd.conf)

    Second: Allowoverride -> Allowoverride all(@httpd.conf)

    Third:(@.htaccess)

    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule  ^dra/?$    draft.php  [NC,L]
    </IfModule>
    

    finally: if my code work the url should be rewritten to localhost/xampp/test/dra/ according to (editted from) url-rewriting for beginner

    mod rewrite not working

    Final result: mod_rewrite not working, as you can see in the picture. Anything that I had left out?