douchen5971 2015-03-01 11:13
浏览 47
已采纳

如何使我的CMS系统与SEO友好的URL一起工作

i got a question abount seo friendly urls.

Manly, i would like to know whats the best way to get my system running with seo friendly urls. i have programmed my own cms system which is working at the moment with url like this:

/content.php?contentid=ID

On every content page you can change the Meta-Tags.

Every LINK which is generated in my CMS follows this structure. If i want to use SEO friendly URLs changing every link, or code, where a link is generated, might be a bad idea. So i am looking for a nicer way. Is there any commonly used way to handle this?

My first idea was to automatically generate a new .htacces file with ModRewrite after the MetaTags of a Contentfile have been changed. So the SEO friendly URLs are recognized by the system. To get the LINKs on every page working i was thinking about checking the current url and redirecting to the new seo friendly url at the beginning of the content.php file.

I dont know if this is the right way to work with seo friendly urls. How are other CMS Systems handling this issue? I would be thankful for any inspiration!

  • 写回答

1条回答 默认 最新

  • dongluxin2452 2015-05-08 23:40
    关注

    if you are using an framework(which i think you are) then you can use a .htaccess like this to send the new cleaner links in an $_GET to the framework:

    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!