views:

30

answers:

3

Let's say that I have a site running CakePHP and I have the prefix "product".

I have lots of pages with URL like:

http://mysite.com/produt/blue-shirt/details
http://mysite.com/produt/blue-shirt/order
http://mysite.com/produt/skate/details
http://mysite.com/produt/sun-glasses/vendors

Now I need to use a domain like http://mysite-blue-shirt.com/ as "shortcut" to the blue-shirt product, and my URLs will become:

http://mysite-blue-shirt.com/details
http://mysite-blue-shirt.com/order

What I need to do?

I think that's something with the .htaccess on the root of the website, outside the app directory.

Here's the current syntax:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>
A: 

For the outside world to see this you would need to register mysite-blue-shirt and all the other variants.

Leo
A: 

Check this link :

http://book.cakephp.org/view/544/Prefix-Routing

Memo Mazaz
+1  A: 

I think you'll need to create your own custom Routing class. Check this: http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp

Mauro Zadunaisky