0

i have this code .htaccess work for laravel framework

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /testing/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$1 [NC,L]
</IfModule>  

which work fine but the problem in framework i go to site example.com/testing

the problem laravel framework read /testing as route

so i have put all route under testing

so the Question is :how can i make apache send PHP route without "/testing" ?

1 Answer 1

1

Simply excluding from the scope all requests that match /testing path. View htaccess docs

RewriteEngine On
RewriteBase /testing/public/
RewriteCond %{REQUEST_URI} !^/testing$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$1 [NC,L]

But anyway you should not do this, you are redirecting your incoming requests to /testing/public/index.php.

You have to configure the virtualhost pointing directly to /public folder in your laravel application as described in http://laravel-recipes.com/recipes/25/creating-an-apache-virtualhost

And this is why you should do: https://security.stackexchange.com/questions/56736/is-web-app-safe-in-not-public-folder

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.