I need the following URLs to be allowed
https://www.example.comhttps://www.example.com/index.phphttps://www.example.com/loginhttps://www.example.com/logouthttps://www.example.com/callback
The rule that I have added in .htaccess is:
Order deny,allow
Deny from all
<FilesMatch "login|logout|callback|index\.php">
Allow from all
</FilesMatch>
### End
DirectoryIndex index.php
# enable apache rewrite engine
RewriteEngine on
# set your rewrite base
# Edit this in your init method too if you script lives in a subfolder
#RewriteBase /
# Deliver the folder or file directly if it exists on the server
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Push every request to index.php
RewriteRule ^(.*)$ index.php [QSA]
Then I am using Steampixel\Route package to process the request:
Route::add('/', function() {
//code to process homepage request
});
Route::add('/login', function() {
//code to process login request
});
Route::add('/logout', function() {
//code to process logout request
});
Route::add('/callback', function() {
//code to process callback request
});
Route::run('/');
URLs /login, /logout, /callback work, however, I get 403 "You don't have permission to access this resource." error when I access my homepage, either with or without / (forward slash )