简体   繁体   中英

url rewriting in php internal server error

i have a project runs from localhost i am using wamp local server to run my project. like localhost/re re is my project folder how can write in url rewriting using .htaccess ,
i tried but it throws an error

here is my .htaccess

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^localhost/re/?$    refer.php    [NC,L]    # Handle requests for "re"

and when i run as localhost/re

error is

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

so how can i do it. Thanks in advance

Amit

You can do this using DirectoryIndex

RewriteEngine On
RewriteBase /re/

DirectoryIndex refer.php

now your default file is refer.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM