问题
I have installed the WAMP server in my windows machine .I have downloaded a simple cakephp application called "samplecake" from net and copy that application to c:WAMP/www And try to run the application using http:localhost/samplecake then it shows the login page (in routes.php i have redirected the '/' to users/login).In my controller the afterlogin redirect to /users/view , But after the successful login it will redirect to /users/view
but it shows an error:Not Found
The requested URL /users/view was not found on this server.
I have tried all the actions that are present in user_controller like /users/add, /users/edit but it shows the same error Not Found he requested URL /users/add was not found on this server
How can i solve this Not found url problem if anyone knows please help me thanks in advance.............
回答1:
Have you enabled the rewrite module in WAMP? This will make the URL rewriting in .htaccess possible.
Info on how to do so: http://www.anmsaiful.net/blog/php/enable-apache-rewrite-module.html
回答2:
Seems like a .htaccess is missing. Please check if you have copied those. Maybe your Windows hid those files, make sure to have enabled that you can see all files on your system.
- Open explorer
- Select the Tools menu and click Folder Options.
- After the new window appears select the View tab.
- Put a checkmark in the checkbox labeled
Display the contents of system folders
. - Under the
Hidden files and folders section
select the radio button labeledShow hidden files and folders
.
Also, please consider working on your accept rate. Please have a view into the FAQ why this is important.
回答3:
1 more addition to the above:
If its windows go to your wamp folder,
Under Folder and search options >> Check the option "Display the extensions for known file types" to verify its a valid php file.
Case: you create a text file and you save it as test.php if this option "Display the extensions for known file types" in unchecked. It appears: test.php instead of test.php.txt
来源:https://stackoverflow.com/questions/6119330/error-the-requested-url-users-view-is-not-found-on-this-server