How to remove part of URl with .htaccess?

后端 未结 5 469
星月不相逢
星月不相逢 2020-12-09 20:28

Currently i have 20+ URLs on my site in this formate

http://www.example.net/content/index/mission

I want to remove /content/index from all URLs, so they shou

5条回答
  •  失恋的感觉
    2020-12-09 21:06

    You would need the rewrite module of Apache: mod_rewrite.

    Then do something like this:

    RewriteEngine on 
    RewriteRule ^content/index/(.*)$ $1
    

    Here is the official documentation of mod_rewrite: click

提交回复
热议问题