2017-06-15 108 views
0

我想用我的.htaccess文件,以確保通過下面的路徑會發生:的.htaccess頁面重新路由 - 讓404

success_stories.php - > success_storie

這裏是什麼我試過,但它不工作,因爲我得到一個404

Options -MultiViews +FollowSymLinks 
# Turn mod_rewrite on 
RewriteEngine On 
RewriteBase/
RewriteRule ^success_stories.php$ /success_storie [L,R,NC] 
+0

這只是一個例子,給我解決方案,我不需要語法錯誤或更正 – ravi9999

回答

1

嘗試類似的東西

## hide .php extension snippet 
# To externally redirect /dir/foo.php to /dir/foo 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] 
RewriteRule^%1 [R,L] 

# To internally forward /dir/foo to /dir/foo.php 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteRule ^(.*?)/?$ $1.php [L]