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)
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\System32\drivers\etc. Add the following line
at the end of it:
127.0.0.1 localmvc
Then you need to edit the httpd-vhosts.conf file in
C:\xampp\apache\conf\extra to look like this:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<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
</Directory>
</VirtualHost>
Be sure to fill in the path to your MVC project. Then just restart Apache and
open http://localmvc