The initial path configuration in wamp. now I enter localhost to automatically run the index. php file under the www folder,
However, I want to display the project homepage when I enter localhost,
Thinkphp is used for projects,
The running address of the homePage is http: // localhost/car_project/index. php/Home/Main/homePage/
Reply to discussion (solution)
You can change the DocumentRoot value of httpd. conf to your project folder.
You can change the DocumentRoot value of httpd. conf to your project folder.
No,
1. directly change to the project folder, and then he automatically loads the index. php file in the folder. it doesn't make sense to load it directly. I want to load the homePage method in the Main controller.
2. no matter how I modify DocumentRoot, it seems that I only give a folder path and cannot specify the homePage method in the Main controller.
You just need to set the default controller for your website.
Wamp seems to have an alias. you can set it. you can set it on Baidu.
Modify the configuration file in apache.
Hide index. php in the htaccess file
Http://www.thinkphp1.cn/code/25.html
Hide index. php in the htaccess file
Http://www.thinkphp1.cn/code/25.html
What was this first time I heard about it?
You can create a site: 1. environment: WAMP2. open php. ini configuration file, search for extension, find extension = php_pdo_mysql.dll, remove the semicolon above 3. open the httpd-conf configuration file and search for AllowOverride. replace All None with All, that is, AllowOverride All, there are three locations to change; search hosts, find Include conf/extra/httpd-vhosts.conf, remove the front semicolon; search LoadModule, find LoadModule rewrite_module modules/mod_rewrite.so, remove the front semicolon. 4. open the apache installation location and search for and open httpd-vhosts. remember to add the VM configuration under the conf \ extra directory.
(Port number, prompt to use, delete when used) DocumentRoot "c:/wamp/www/car_project/index. php/Home/Main/homePage/"(Root File Directory, prompt to use, delete when used) ServerName www.car.com (domain name, prompt to use, delete when used) DirectoryIndex index. php)
5. search for and open hosts in drive C windows. Note that it is under windows \ System32 \ drivers \ etc and add 127.0.0.1 www.car.com at the bottom (the domain name depends on the settings above) 6. restart apache7 and enter www.car.com in the browser.
I have solved this problem in another post a while ago. thank you!
In the server configuration, set DocumentRoot "D:/wamp/www /"
Change www/To www/car_project/
Then modify the Application/Common/Conf/configuration file in your project.
'Default _ THEME '=> '', // DEFAULT Template topic name
'Default _ module' => 'home', // DEFAULT MODULE
'Default _ controller' => 'main', // default controller name'
DEFAULT_ACTION '=> 'homepage', // Default operation name