.htaccess在ubuntu服务器上无法正常工作

时间:2015-06-01 07:43:19

标签: php apache .htaccess url-rewriting ubuntu-12.04

RewriteRule    ^profile?$    profile.php    [NC,L]
RewriteRule    ^profile/?$    profile.php    [NC,L]
RewriteRule    ^profile/([0-9]+)/?$    profile.php?profile_id=$1    [NC,L]    # Handle product requests
RewriteRule    ^profile/([0-9]+)/([a-z0-9A-Z]+)/?$    profile.php?profile_id=$1&p=$2    [NC,L]    # Handle product requests
RewriteRule    ^profile/([0-9]+)/([a-z0-9A-Z]+)/([a-z0-9A-Z]+)/?$    profile.php?profile_id=$1&p=$2&id=$3    [NC,L]    # Handle product requests
RewriteRule    ^([a-z]+)/?$    index.php?p=$1    [NC,L]    # Handle product requests

当我打开

{url}/profile/{profile_id} 

请求将发送到profile.php,但无法通过$ _REQUEST ['profile_id']访问profile_id。 所有其他请求都正常工作。

任何人都可以帮助可能的原因吗?

1 个答案:

答案 0 :(得分:-1)

尝试按MultiViews禁用@ValdimirDimitrov's comment选项。