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 should look something like this
http://www.example.net/mission
In other words I would to always remove /content/index from the url. I'm sure it's really straight forward, but I'm not very experienced with Apache.
I also have a script I wrote that you put on your server then browse to it via internet browser and it can confirm if you have mod_rewrite on your server. The way I showed you works 100% as long as mod_rewrite is enabled
I'm going to guess you already have some rewrite rules in place for URLs like http://www.example.net/content/index/mission
You need to find these rules and add a new one which uses a similar structure but 'hard codes' the content/index parts, for example, suppose the existing one was
You'd want to make a new rule to pick up /mission and rewrite it in a similar way, but before the existing rule kicks in, e.g.
These are just examples - it will really depend on what your existing rules are.
You would need the rewrite module of Apache:
mod_rewrite
.Then do something like this:
Here is the official documentation of mod_rewrite: click
Or just add index.html depending on whatever extention you want to remove and MOD_REWRITE is required on Apache for this to work. Thank you.