Forum Moderators: phranque
I have an application running on OpenCMS. Unfortunately, OpenCMS sets up such that the Servlet URL is /cms/opencms/...... (ie. eg. http://www.example.com/cms/opencms/......)
It seems like OpenCMS does not allow this to be changed anywhere in its config and properties files.
For security reasons, I do not wish this portion of the url to appear. As such, how can I use Apache to rename this? (eg. http://www.example.com/webapp/..... gets translated to http://www.example.com/cms/opencms/....)
The Redirect directive will makes the url appear on the browser (doesn't solve the security issue). Alias directive is really more to map to a physical file path which in this case is different.
any advice is greatly appreciated.
thanks alot
[edited by: jdMorgan at 4:11 pm (utc) on April 12, 2005]
[edit reason] Examplified. [/edit]
How can I run [example.com...] but make it look like this [example.com...]
in the users browser.
Is this correct?
The thing most people try to do is go the wrong way... EG they try to write a rule that changes the 'real' URL to a 'fake' one - can't do it. You must go the other way, so when a user clicks on a 'fake' URL mod_rewrite changes the file that opens to the 'real' one.
This explains it fairly well [webmasterworld.com...]
Your RewriteRule will probably look something like...
RewriteRule ^webapp/(.*) /cms/opencms/$1 [L]
Your variable ending (.*) can be a number of different regular expressions depending on the name structure of your actual files and paths. If they are a set pattern, then you can use a regular expression that will catch that patternEG letters only then .whatever you can use ([a-z]+)\.whatever and change your rule to...
RewriteRule ^webapp/([a-z]+)\.whatever /cms/opencms/$1.whatever [NC,L]
Once you get the concept of what mod_rewrite does, you can probably follow a few of the threads and find the right expression, or set of expressions, for your specific situation. (I don't know the threads well enough to tell you which ones are most applicable.)