url Category.phpとProfile.phpをURL frindlyに変換したいが、それが機能しているカテゴリのみに変換したい。私は一致するグループを使用したくない!2ページのURL一致するグループのない書き換え
例:
domain.com/category.php?id=5
と
domain.com/profile.php?id=2
変換:
domain.com/categoryname
domain.com/profilename
の.htaccessコード:
RewriteEngine on
#category
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^/.]*)$ category.php?id=$1
#profile
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([^/.]*)$ profile.php?&id=$1
しかし、それは唯一のカテゴリのために働きます!これは動作するはず
おかげ
これはmanny timesここで答えました:P – Blueblazer172
あなたはprofile.phpに 'profile /([^/.]*) 'のように別のマッチンググループを使わなければなりません。同じマッチンググループを使って2つのファイルにデータを送ることはできません。 –
[.htaccessでフレンドリーなURLを作成するにはどうすればいいですか?](http://stackoverflow.com/questions/3033407/how-can-i-create-friendly-urls-with-htaccess) – Blueblazer172