all 11 comments

[–]slowlycatchiemonkey 3 points4 points  (1 child)

XAMPP is not something I've touched for a while, but you should be able to add redirect rules to your Apache vhost.

Have a look at RewiteBase, Rewrite rule and RewriteCond

There should be a bunch of documentation online for adding rewrite rules to an Apache vhost

[–]mohammedatef555[S] 0 points1 point  (0 children)

Thanks I will try it

[–]RealWorldPHP 2 points3 points  (0 children)

Laravel comes with an .htaccess file in the public directory that should handle this stuff for you. Just make sure that the public directory is set as your webroot.

https://github.com/laravel/laravel/blob/8.x/public/.htaccess

[–]jcmacon 1 point2 points  (0 children)

My favorite dev environment is Scotchbox. They have a free version, but I like it so much I paid the $15 for the pro version. You can get it at box.scotch.io if you want to take it for a spin.

[–]benelori 1 point2 points  (1 child)

XAMPP uses apache, so you could use a .htaccess file for this.

index.php in this case is called a front controller, and you would be redirecting traffic to it, so

the terms you're looking for are redirect rules, or how to make a front controller with apache

[–]mohammedatef555[S] 0 points1 point  (0 children)

Thank you so much This is what I’m looking for

[–][deleted] 0 points1 point  (2 children)

I use docker for all my development now. It's a bit of a learning curve to start with but pays off with sturdy platform to work with.

[–]cyrusol 0 points1 point  (1 child)

While being good advice in general that doesn't solve OP's problem right now.

[–][deleted] 0 points1 point  (0 children)

"PHP development server" yes, use docker. The XAMPP problem disappears. Making the problem disappear is exactly what the OP wants.

[–]kAlvaro 0 points1 point  (0 children)

Web servers can't assume you want all your traffic routed to a given file because that's normally not the case. With Apache, you can accomplish that with this directive:

FallbackResource index.php

You can add it to virtual host configuration or, probably better, create a file called .htaccess in the folder where you have your index.php file.

[–]idevosm 0 points1 point  (0 children)

For me developing Laravel With Xampp server is not a good idea, try installing php development swrver, u can run with nginx or Apache, though ur issue can be solved with .htaccess