0

I use a MVC that would load this url website.com/controller/action by accessing the 'controller' directory and looking for a file called action.php which works great.

No I have some longer urls that I would like to clean, say I have:

webiste.com/home/page/parameter1/parameter2
webiste.com/home/page/x/y
webiste.com/home/page/test1/test2

So I have a directory called 'home', a file called 'page.php' and the rest are just get parameters.

The question, is there a way to use .htaccess to remove /home/page/ from the url but assume that the controller 'home' and the action 'page.php' still need to be called?

This is my .htaccess file by the way:

RewriteEngine On

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
tereško
  • 58,060
  • 25
  • 98
  • 150
matt
  • 2,312
  • 5
  • 34
  • 57
  • How should `parameter1/parameter2` be passed to `page.php`? – anubhava Jun 05 '14 at 10:53
  • I'm now thinking that this might not be possible with just .htaccess I will probably have to write some function to take care of this, although I'm not completely sure what it should do. – matt Jun 05 '14 at 10:54
  • this post should help: http://stackoverflow.com/a/19309893/727208 – tereško Jun 05 '14 at 11:49

0 Answers0