0

Links

<a href='/'>Home</a>
<a href='/contact'>Contact</a>
<a href='/johnsmith'>Profile 1</a>
<a href='/john.smith'>Profile 2</a>
<a href='/john_smith'>Profile 3</a>
<a href='/john-smith'>Profile 4</a>
<a href='/1_john.smith_1'>Profile 5</a>

my user contains -._ letters and digit in the user ID

.htaccess

RewriteEngine On
RewriteRule ^([a-z]+)/?$    index.php?view=$1  [NC,L]
RewriteRule ^([a-z0-9_-]*[\.]*[a-z0-9_-]+)/?$    index.php?view=profile [NC,L]

the problem is only the second rule is applied
means whichever link i clicked it goes to index.php?view=profile
please tell me the proper way of using this

4

1 回答 1

0

第一个规则将匹配第二个和第三个链接,只有这些仅包含您实施的规则所要求的小写字母。

于 2013-07-10T16:50:26.177 回答