Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.