문제

I tried the following lines in .htaccess file and put it in includes folder:

//301 Redirect Old File
RewriteEngine on
Redirect 301 includes/config.php includes/index.php

I want when any user opens this file using url that he/she must be redirect to includes/index.php file. But I got the 500 server error.

도움이 되었습니까?

해결책

Reason of your 500 error is: Redirect to non-URL

As you're missing leading slash in your matching pattern and target URL.

Use this rule to fix it:

Redirect 301 /includes/config.php /includes/index.php

다른 팁

try:

Redirect 301 /includes/config.php http://yoursite.com/includes/index.php

Although, if the htaccess is in the includes dir then you don't need /includes at all. The second url must also be full - as above.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top