Hi ppl,
I need the apache rewrite rule to turn this:
mydomain.com/index.php?aboutme&lang=deutsch&empl=mm
to:
mydomain.com/deutsch/mm/aboutme.phtml
is this possible and if yes, could anyone give me the fitting rewrite rule or some more information were I can find tutorials on this topic?
mod_rewrite rule for index.php?deutsch&lang=deutsch&
I would really love the same.....
http://www.studmed.dk Portal for doctors and medical students in Denmark
-
- Posts: 23
- Joined: Thu 28. Oct 2004, 13:04
- Location: London
use the alias function.
type in the alias field :
deutsch/mm/aboutme
You will need to add this code to the <head> of your template:
<base href="http://www.yourdomainhere.com/">
You need this base ref or the cms will try and find all your images etc in the mm folder (which doesnt exist!). I think you can do that with the htaccess file but not sure....
If anyone has a better way please share
type in the alias field :
deutsch/mm/aboutme
You will need to add this code to the <head> of your template:
<base href="http://www.yourdomainhere.com/">
You need this base ref or the cms will try and find all your images etc in the mm folder (which doesnt exist!). I think you can do that with the htaccess file but not sure....
If anyone has a better way please share

-
- Posts: 23
- Joined: Thu 28. Oct 2004, 13:04
- Location: London
Maybe i misunderstood you?
I thought you just wanted to have your friendly urls look like they are in directories ie
http://www.directories.com/like/this/index.phtml
sorry if this is not what you were after....
I thought you just wanted to have your friendly urls look like they are in directories ie
http://www.directories.com/like/this/index.phtml
sorry if this is not what you were after....
Thats what I would like....Jimmy_Jazz wrote:Maybe i misunderstood you?
I thought you just wanted to have your friendly urls look like they are in directories ie
http://www.directories.com/like/this/index.phtml
sorry if this is not what you were after....
http://www.mysite.com/levelname/sublevelname/page.phtml
Like
http://www.mysite.com/products/computers/laptop.phtml
http://www.studmed.dk Portal for doctors and medical students in Denmark
yes me too... this is absolutely possible through the alias function!
so if you have a site structure like this:
home
- page 1
-- page 1.1
-- page 1.2
- english 2
-- page 2.1
--- page 2.1.1
simply name the aliases of the pages like this:
alias of home is:
/home/
alias of page 1 is:
/home/page1/
alias of page 1.1 is:
/home/page1/page1.1/
and so on...
alias of page 2.1.1:
/home/page2/page2.1/page2.1.1/
thats very easy to realize but my problem was anotherone!
I use redirection to define the variables for each category:
so for example if my page looks like this:
- german
-- firma
- french
-- entreprise
- english
-- company
then for example my redirection for german looks like this:
index.php?german&lang=german&empl=mweber
where lang is the language of my navigation (can't use a dynamic one in my template so I define it through an external, hardcoded template) and
empl is employee because for each article I want to have the possibility to define someone who is responsible for this section and thus load his / her contact information from another external, hardcoded template.
I guess that now you can see why I need to use the mod_rewrite function and can't count on the alias function or does anybody know a way to handle the following:
if my page alias was the following (systematic is as described above):
/home/mweber/german/product/
could I then read the information out of this string by php
(could I create a function that would turn this string into the following ?
<?php
lang=german
empl=mweber
?>
so if you have a site structure like this:
home
- page 1
-- page 1.1
-- page 1.2
- english 2
-- page 2.1
--- page 2.1.1
simply name the aliases of the pages like this:
alias of home is:
/home/
alias of page 1 is:
/home/page1/
alias of page 1.1 is:
/home/page1/page1.1/
and so on...
alias of page 2.1.1:
/home/page2/page2.1/page2.1.1/
thats very easy to realize but my problem was anotherone!
I use redirection to define the variables for each category:
so for example if my page looks like this:
- german
-- firma
- french
-- entreprise
- english
-- company
then for example my redirection for german looks like this:
index.php?german&lang=german&empl=mweber
where lang is the language of my navigation (can't use a dynamic one in my template so I define it through an external, hardcoded template) and
empl is employee because for each article I want to have the possibility to define someone who is responsible for this section and thus load his / her contact information from another external, hardcoded template.
I guess that now you can see why I need to use the mod_rewrite function and can't count on the alias function or does anybody know a way to handle the following:
if my page alias was the following (systematic is as described above):
/home/mweber/german/product/
could I then read the information out of this string by php
(could I create a function that would turn this string into the following ?
<?php
lang=german
empl=mweber
?>
ok I did it 
I had to use a little trick:
Example:
my category alias is:
company
then I forward this category to:
mweber_company_deutsch.phtml to make apache redirect this url to:
index.php?company&lang=deutsch&empl=mweber
I recommend you to use at maximum one subdirectory !
I don't use any because otherwise you have to reorganize all your templates and paths to images etc. because wcms will for example try to load your stylesheets from:
yourvirtualsubdir/include/inc_css/frontend.css

Code: Select all
RewriteRule ^([a-z]+)_?([a-z]+)?_?([a-z]+)?\.html$ index.php?$2&lang=$3&empl=$1 [L]
Example:
my category alias is:
company
then I forward this category to:
mweber_company_deutsch.phtml to make apache redirect this url to:
index.php?company&lang=deutsch&empl=mweber
I recommend you to use at maximum one subdirectory !
I don't use any because otherwise you have to reorganize all your templates and paths to images etc. because wcms will for example try to load your stylesheets from:
yourvirtualsubdir/include/inc_css/frontend.css