0

URLから.phpを削除するためのスクリプトが1つあり、2番目のスクリプトはユーザー名を渡します

# activate rewrite engine
RewriteEngine On

# WordPress rules
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# username in url
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /x/profile.php?username=$1
4

1 に答える 1

1

非常にシンプルで、すべてを1つのファイルにまとめます。

RewriteEngine On

# Combined rules
RewriteRule ^(.*)$ /x/profile.php?username=$1
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
于 2013-03-03T21:47:26.083 に答える