Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL rewriting on WAMP #19

Open
patriziasunny opened this issue May 20, 2019 · 2 comments
Open

URL rewriting on WAMP #19

patriziasunny opened this issue May 20, 2019 · 2 comments

Comments

@patriziasunny
Copy link

Hello and thanks for this book!
First of all I'm on php so maybe it's a silly question.

I have a problem when a try to rewrite URL on chapter 9:

I think that the problem is in the following line on Cms-EntryPoint-Class (index.php)

$route = ltrim(strtok($_SERVER['REQUEST_URI'], '?'), '/');

because it duplicate my URL after "public":

http://localhost/Project2/phpmysql6-Sessions-CheckUser-Secured/public/project2/phpmysql6-sessions-checkuser-secured/public/

I tried to give a empty string to $route and it works for the index page, but obviously the other links in the page doesn't work.

I also try to create an .htaccess file in the public directory and I try to change the Apache root folder in httpd.conf but it doesn't work for me and give me back an error 500.

@TRPB
Copy link
Collaborator

TRPB commented May 20, 2019

I also try to create an .htaccess file in the public directory and I try to change the Apache root folder in httpd.conf but it doesn't work for me and give me back an error 500.

This is the right approach, you'll need the .htaccess file in the public directory and the public directory will need to be the DocumentRoot.

@bobate
Copy link

bobate commented Nov 12, 2019

@patriziasunny did you solve the url rewrite issue? I had the same problem, drove me crazy for over a week. I solved it by changing DocumentRoot in httpd.conf to "C:/xampp/htdocs/Project/public". (Along with the .htaccess file.)
I see you tried that and it didn't work, but I'm certain that's what did it for me. Don't know if WAMP and XAMPP handle it the same.
I'm almost a year behind you, been working thru the book over last 2 months, running into new roadblocks every day/week, taking at least a few days to solve each one. I got thru Categories and I think that was running ok, but now I hit another wall with Permissions.
I'm hoping to find some noobie like me to collaborate with in working through the book and duplicating the website/framework. And trying to wrap my head around the whole process. Are you still working on it?
Thanks
Nate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants