Route/create a sub-domain in CakePHP, how to - php

I've tried solutions as such, but they don't see to address the problem Im at.
How to create a sub-domain in CakePHP?
I have a CakePHP app in publichtml/lastroarte.com running ok. I went to my DNS and created for a subdomain entries for sandbox.lastroarte.com a test subdomain for the new version of my which we'll be upload the new app.
If I browse to the subdomain now, it redirects me the home page of my domain, still displaying the url sandbox.lastroarte. I've found entries for the pages in the Routes file of Cake, although I have not found way to say a subdomain should display the index of its own folder (public_html/sandbox.lastroarte.com). Am I doing the right approach? How to achieve this?
Appreciate your answers.

(Assuming you are running apache as your web server)
You have created a sub-domain, but have you created sites-available and sites-enabled files and restarted apache?
If you are using your host's control panel it will do this for you, but you will need to associate your public_html/sandbox.lastroarte.com directory to the sandbox.lastroarte.com sub-domain.
In short this doesn't sound like a Cake routing problem, it sounds like apache is routing traffic from sandbox.lastroarte.com to lastroarte.com.

Related

Redirect From Subdirectory To Different Subdirectory

I have a Laravel website that is hosted using DigitalOcean. I would like www.domain.com/1 to be redirected to www.domain.com/2. How can I achieve this? Does this need to be done within my Laravel application, or do I need to do something in my NGINX config file?

URL redirect to dynamic subdomain

I currently have a website (ab.example.com), where 'example.com' is the company's root domain. and 'ab' is a product's subdomain(website). Within the website (ab.example.com), I have multiple sub-products (gala, granny smith, fuji).
When a customer goes to ab.example.com/apples/gala I want them to be redirected as gala.example.com/apples. Similarly for any other sub-products I have. I understand that this is similar to .htaccess redirect to subdomain based on query string parameter, where .htaccess at the root folder is being used to add the redirect rules.
But does this mean that no changes have to be made in the cpanel or update dns entries for the new subdomains? I have also looked into the wildcard domain methood - Create subdomains on the fly with .htaccess (PHP).
I am confused about which method to use. I'm fairly new to php and its frameworks. The web application is in ,
php
Laravel
Azure
Apache
Linux(Ubuntu)

Set url to level above installation directory Wordpress

I don't know if it is even possible so that's why I put my question here.
We have a webserver running a PHP application build within the Yii-framework and we have also integrated Wordpress into that application.
The root contains the Yii-application and a dir with the wordpress installation. Now I would like to know if it's possible to create a page and have it a url outside it's installation dir.
An example:
domain.com shows the Yii application index
domain.com/blog shows the Wordpress homepage
Now I want to create domain.com/foobar and the page foobar comes from Wordpress.
Is it possible and how?
Kind regards,
Pim
Your server will have been setup with your domain name. I don't know if you are using a hosted service, or a cloud based option, but either way you should be able to tell your web server to load different index.php files based on the URL.
Every single web request comes through your web server. You can tell your web server to load different php files depending on the http request URL.
For example, when you setup your sever with domain.com you would have had to (or in most cases its the default) tell your web server to route all domian.com requests to /public/index.php
Following this logic, if you want to load a different index.php file from a different URL, you just have to set this up in your web server. So domain.com/foobar would point to /some/directory/public/index.php
The way you do this very much depends on your server and if you have some server admin software installed e.g. cPanel.

Magento Multi Site on Amazon Cloud

I'm trying to migrate our Magento to Amazon Cloud.
Currently we have this setup:
www.xyz.com (/var/www/vhosts/xyz.com/httpdocs)
This is where Magento is setup:
www.abc.com
This is where our Wordpress is setup:
www.abc.com/store/
This is a multi store setup to use the code in xyz.com with index.php calling the Magento app.
Initially, I was thinking of using 1 EC2 instance for Magento and another EC2 instances for the Wordpress. Then I would setup 2 Elastic IPs to the 2 instances and then point abc.com and xyz.com to their EIPs accordingly.
However, I can't think of a way for the /store/ folder under abc.com to use the same source code for Magento.
Could anyone advise?
Thanks.
I'm not quite sure about your needs but I would recommend to have store.abc.com as subdomain - this way you can link xyz.com and store.abc.com to the same folder and keep abc.com to the main wordpress folder. But again need to look deeper into the setup. we just transferred one of the store to amazon AWS.
Your only option is a Proxy. Everything else (Like mod_rewrite / Alias) will do a header redirect, and expose the target address to the user.
However, Apache's proxying doesn't seem to be that complicated. The most basic example is
ProxyPass /mirror/foo/ http://backend.example.com/
Note that a proxy will of course double your traffic, because every byte requested will have to be fetched from the remote machine.
Source: Sub Directory to a different server

How do I move from virtual subdirectory to a subdomain?

I have a website with multilingual support which you can access with virual subdirectory.
For example:
www.domain.com/ru/
which is actually
www.domain.com/index.php?lang=ru
(i'm doing it with .htaccess).
Since I decided to host every language in a different host, I need to make the site use subdomains instead of subdirectory.
However i'm kinda lost here.
I tried to create a subdomain (I use DirectAdmin) and than use .htaccess to do the same thing I do with the subdirectory, but for some reason when I go to ru.domain.com i'm redirected to www.domain.com/index.php?lang=ru...
Thank you very much,
Yolei

Categories