2012-01-30 8 views
1

私は別のサーバーでApacheを使用していますが、.htaccessを使用していますが、何らかの理由で "ページが見つかりません" 「このサーバーに要求されたURL/about-usが見つかりませんでした」というメッセージが表示されます。ブラウザで URLは次のようになります。.htaccessは404に行きます - URL書き換え

私のコードwww.mysite.com/about-us以下の通りである:すべてのヘルプは おかげ

+0

新しいホスティングプロバイダはmod_rewriteをサポートしていますか? –

+0

私のコードをの中に追加しました。 DirectoryIndex index.phpをDirectoryIndex index.htm index.phpに変更しました。これでサイトはindex.htmに移動します。 mod-rewriteが有効になっていると思います。 – fred

+0

回答: 'RewriteRule ^(。*)$ /index.php?mode=$1 [L、QSA]' – fred

答えて

0

を高く評価し

RewriteEngine on 
Options +FollowSymlinks 
DirectoryIndex index.php 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_URI} !=/favicon.ico 
RewriteRule ^(.*)$ index.php?mode=$1 [L,QSA] 

あなたのfavicon.icoを条件とすることができます試合を破るパターンを無効にするには、辞書順に一致するものを否定する代わりに!を使用します。

RewriteEngine on 
Options +FollowSymlinks 
DirectoryIndex index.php 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !^favicon\.ico [NC] 
RewriteRule ^(.*)$ index.php?mode=$1 [L,QSA]