How to make Pretty URL using .htaccess

霸气de小男生 提交于 2020-01-11 13:21:07

问题


I have link

http://musicfoorti.com/categorylist/57/0/1.html
http://musicfoorti.com/fileDownload/75/jhalak-dikhla-jaa-reloadedmp3.html
http://musicfoorti.com/download/75.html

and I want to make links look like below

http://musicfoorti.com/music.html
http://musicfoorti.com/jhalak-dikhla-jaa-reloadedmp3.html
http://musicfoorti.com/jhalak-dikhla-jaa-reloadedmp3/download.html

Here is my .htaccess code

Options -MultiViews +FollowSymlinks -Indexes

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^categorylist/([0-9]+)/([0-9]+)/([0-9]+)\.html$ /index.php?pid=$1&sort=$2&page=$3 [L]

RewriteRule ^fileDownload/([0-9]+)/(.*)\.html$ /file.php?fid=$1 [L]

RewriteRule ^download/([0-9]+).html$ /file.php?fid=$1&download [L]

RewriteRule ^([0-9]+)/updates\.html$ /updates.php?page=$1 [L]

RewriteRule ^search\.html$ /search.php [L]

RewriteRule ^index\.html$ /index.php [L]

<IfModule mod_env.c>
SetEnv SEO_SUPPORT 1
</IfModule>
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>

来源:https://stackoverflow.com/questions/59162889/how-to-make-pretty-url-using-htaccess

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!