2012-04-19 5 views
0

私たちは、サイトの構造を変更していると、古いURLは次のようになります。の.htaccessチェック

http://www.website.co.uk/niceurl 

そして、私はこの.htaccessファイルを持っている:

http://www.website.co.uk/pages.php?PageId=7 

新しいURLはそれは私が使用しているCMSに付属しているので、そのコア機能を別々に動作させることはできません。私は本当にやりたい

<IfModule mod_rewrite.c> 

Options +FollowSymLinks 

RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME}/index.html !-f 
RewriteCond %{REQUEST_FILENAME}/index.php !-f 

RewriteRule ^(.*)$ index.php/$1 

</IfModule> 

pages.phpが要求されたので、ルール無視した場合に取得されたかどうかを確認です:

RewriteRule ^PageId=7(.*)$ /niceurl [R=301] 

RewriteRule ^(.*)$ index.php/$1 

を次に、このルールの後のような何かを

ご協力いただければ幸いです。

答えて

0

ソリューション:

<IfModule mod_rewrite.c> 

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME}/index.html !-f 
RewriteCond %{REQUEST_FILENAME}/index.php !-f 

RewriteCond %{QUERY_STRING} !(PageId=7) 

RewriteRule ^(.*)$ index.php/$1 

RewriteCond %{QUERY_STRING} PageId=7 
RewriteRule .* /niceurl? [R=302,L] 

</IfModule>