sb13 Posted June 6, 2011 Share Posted June 6, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/ Share on other sites More sharing options...
requinix Posted June 6, 2011 Share Posted June 6, 2011 Uh... do you have more examples? Or is this thing just for that one front page? Quote Link to comment https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/#findComment-1226051 Share on other sites More sharing options...
sb13 Posted June 7, 2011 Author Share Posted June 7, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/#findComment-1226299 Share on other sites More sharing options...
requinix Posted June 7, 2011 Share Posted June 7, 2011 Can you not set up default controllers and actions? That would be the "proper" MVC approach. Quote Link to comment https://forums.phpfreaks.com/topic/238573-rewrite-sub-folder/#findComment-1226344 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.