Forum Moderators: phranque
I only need a really simply mod_rewrite but I find it really hard. I ended up needing to have 2 slashes...
I am passing a parameter to a script that contains
slashes as the parameter represents a thematic directory branch.
For instance:
intranet.dep/arznei/category.asp? branch=/ext/neu/hormone/mineralkortikoide/aldosteron
the categories can be up to 5 levels.
I am thinking of mapping this category structure to the
url structure to navigate the website more intuitively.
I would like to have a url structure like:
intranet.dep/arznei/hormone/mineralkortikoide/aldosteron
(also to skip the ext/neu bit as it is always the same)
How would you do that?
Welcome to WebmasterWorld [webmasterworld.com]!
In accordance with our Charter [webmasterworld.com], we can't write the code for you, but if you'll post your best effort and your test results, we *can* help you debug it.
Here are some references to help you get started:
Apache mod_rewrite documentation [httpd.apache.org]
Apache URL Rewriting Guide [httpd.apache.org]
Regular Expressions Tutorial [etext.lib.virginia.edu]
Jim
Rewrite Rule ^arznei/(.*)$ /category.asp?c=/ext/neu/$1
So if I enter:
intranet.dep/arznei/hormone/mineralkortikoide/aldosteron
this should become:
intranet.dep/category.asp?c=/ext/neu/hormone/mineralkortikoide/aldosteron
i havent put it in the previous mail as i wanted to have an unbiassed solution. maybe it is also possible to do it in a completely different way.
Thanks if you could help me!