开发者社区> 问答> 正文

PHP中使用.htaccess的漂亮URL

我有一个链接,这是

  1. http://musicfoorti.com/categorylist/57/0/1.html

假设http://musicfoorti.com/categorylist/61/0/1.html这是宝莱坞电影歌曲类别,我想将其重写为http://musicfoorti.com/bollywood-movie-songs.html

这意味着每个类别链接都将类似于http://musicfoorti.com/category-name.html ,这是我的.htaccess新代码,.htaccess所以我不能这样做。选项-MultiViews +关注符号链接-索引

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>

这是我的PHP代码

                 <div>
                    <h3><a href="'.$sabb->settings['url'].'/categorylist/'.$file['fid'].'/'.$sort.'/1.html">'.escape($file['name']).'</a></h3>
                    <div class="listbox-tags">'.sprintf($_admin, $file['fid'], $file['fid']).'</div>
                </div>                    

请告诉我该怎么办?

展开
收起
社区秘书 2019-12-04 13:49:36 723 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
PHP 2017.北京 全球开发者大会——高可用的PHP 立即下载
PHP安全开发:从白帽角度做安全 立即下载
复杂PHP系统性能瓶颈排查及优化 立即下载