Get up to 80 % extra points for free! More info:
This week up to 80% off on Python courses. More info:

Discussion: Simple object-oriented CMS in PHP (MVC)

cécile:6/4/2017 13:18

Hi guys,

I follow the courses Simple object-oriented CMS in PHP (MVC) but i need to put my project in an another folder than htdocs. I would like a thing like that htdocs/mvc/

I tried to modify the .htacces but no success.
Can you help me please? (sorry for my bad english)

6/4/2017 13:18
David Capka team
Replies to cécile
David Capka:6/4/2017 17:19

You can't do this, the system needs to be in the root folder in order to keep all the links working because it uses pretty URLs. However, you can easily move it to another domain, like "localmvc" instead of "localhost". You can target the new domain to any folder. If you're using XAMPP, this can be managed using XML configuration.

As first, you need to edit the hosts file (it's a Windows file with no extension located in C:\Windows\Sys­tem32\drivers\et­c. Add the following line at the end of it:               localmvc

Then you need to edit the httpd-vhosts.conf file in C:\xampp\apache\con­f\extra to look like this:

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost

<VirtualHost *:80>
    DocumentRoot "fill in the path to your MVC project"
    ServerName localmvc
    <Directory "fill in the path to your MVC project">
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require all granted

Be sure to fill in the path to your MVC project. Then just restart Apache and open http://localmvc

Edited 6/4/2017 17:25
Up Reply
6/4/2017 17:19
You can walk through a storm and feel the wind but you know you are not the wind.
Replies to David Capka
cécile:6/4/2017 19:47

Thank you very much :)

Up Reply
6/4/2017 19:47
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

3 messages from 3 displayed.