简体   繁体   中英

What is wrong with my short URL rewrite code?

I am trying to rewrite a URL from mysite.com/123 to mysite.com/redirect.php?referral=123

Currently, my .htaccess file is using the code:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)$ redirect.php?referral=$1AddHandler php-files .php

I'm positive it was working before, but now I get a 500 error code.

The last two lines of your file appear to have been concatenated. Change it to:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+)$ redirect.php?referral=$1
AddHandler php-files .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