Jump to content

Rewrite sub folder


sb13

Recommended Posts

Sorry for the bad title. What I want to do is add a rewrite rule if the URL is mydomain.com/xxx so that it becomes mydomain.com/xxx/pages/front/. That is, I want to check for 3 letters after the domain name and then I want to add those 3 letters to the page the Apache server will actually read.

 

I tried a few things, but haven't made it work (yes, I'm a noob at this).

 

RewriteRule   ^[a-z]{3}$ $1/pages/front/

 

Can anyone please help me? Thanks a lot.

Link to comment
https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/
Share on other sites

What I want to accomplish is that a user can change language on my system by clicking on a link. These language links will point to www.mydomain.com/languagecode. Here are a few examples

 

mydomain.com/en

mydomain.com/fr

mydomain.com/de

 

However, my system is built with the MVC (Model View Controller) pattern, so I would like for Apache to actually load the below.

 

mydomain.com/en/pages/front/

mydomain.com/fr/pages/front/

mydomain.com/de/pages/front/

 

So, "mydomain.com/en" loads "mydomain.com/en/pages/front/", etc. :)

 

That's really it. I hope that helps. :)

Link to comment
https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/#findComment-1226299
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.