RewriteRule in .htaccess not working

前端 未结 3 366
野的像风
野的像风 2021-01-12 19:56

I am currently running Apache2 on my local machine, installed with the latest version of Ubuntu.

I am trying to get basic URL rewriting working by using the .htacces

3条回答
  •  野的像风
    2021-01-12 20:48

    You need to remove the contextual path prefix from your pattern when using mod_rewrite in a .htaccess file. In the case of the root directory, the path prefix is just /. So try this:

    RewriteRule ^doesnotexist/(.*)$ /page.php?p=$1
    

提交回复
热议问题