如何使用.htaccess删除部分URl?

Sal*_*lam 7 apache .htaccess mod-rewrite

目前,我的网站上有20多个网址

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

我想从所有网址中删除/ content/index,所以它们看起来应该是这样的

http://www.example.net/mission

换句话说,我总是从网址中删除/ content/index.我确信它非常直接,但我对Apache不是很有经验.

jan*_*ver 14

你需要Apache的重写模块:mod_rewrite.

然后做这样的事情:

RewriteEngine on 
RewriteRule ^content/index/(.*)$ $1
Run Code Online (Sandbox Code Playgroud)

这是mod_rewrite的官方文档:click