私は以下を達成する.htaccessファイルを作成しようとしています
- この www.mydomain.com/About-Us のようなきれいな URL をページ page.php?title=About Us で作成します
- この www.mydomain.com/?search=abc のような URL で渡されたパラメーターを使用してデータベースにクエリを実行すると、ページ index.php?search=abc にプルされます
これはこれまでの私のコードです
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^?search=([0-9]*)$ index.php?id=$1 ## e.g www.mydomain.com/?search=try
RewriteRule ^([A-Z]*)$ page.php?name=$1
## www.mydomain.com/About-Us
##ErrorDocument 404 PageNotavailabale
####Protect the system from machines with worms
RewriteRule (cmd|root)\.exe - [F,E=dontlog:1]
#### To hold and redirect css/images/js files
RewriteRule images/(.+)?$ images/$1 [NC,L]
RewriteRule css/(.+)?$ css/$1 [NC,L]
RewriteRule js/(.+)?$ js/$1 [NC,L]