0

I am beginner webdeveloper. I have small problem with redirect.

I have this htacess:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
       Options -MultiViews -Indexes
    </IfModule>

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

    RewriteCond %{HTTPS} !on
    RewriteRule (.*) https://domain.pl [R=301,L]

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

It's work fine. Now I need redirect from https://domain.pl/index.php and https://domain.pl.html to https://domain.pl

I use Laravel 8.

How can I make it?

1

1 Answer 1

3

The simplest way would be

Route::get('/index.html', function(){ return redirect('http://domain/'); });
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.