Reputation: 46
I have to rewrite url. I am using slim framework v3 to create api. My current url is like this,
current url = https://apps.example.com/app/v1/myapp/api.php/signin
But i want remove api.php extention so need url like this
https://apps.example.com/app/v1/myapp/signin
I know we have to rewrite url in .htaccess file, i tried same. my .htacees file is like this
##Workign on normal server
RewriteEngine on`
RewriteCond %{HTTPS} =off
RewriteCond %{HTTP_POST} !^www.myapp.com [NC]
RewriteRule ^(.*)$ https://www.myapp.com/$1 [L,R=301]
I tried solution from slim documentation but not working.. please help me.. thank u..
Upvotes: 1
Views: 516
Reputation: 321
Basically you wont need to create separate file for each function in slim framework, slim 3 builtin router functionality will handle this for you.
visit : https://www.slimframework.com/docs/objects/router.html
Upvotes: 1