How to fix revolution slider in my website?

363 Views Asked by At

I am using revolution slider in my Laravel website.When i removed the "/public" from the url using a .htaccess file in my root folder with this code:

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

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php

The slider is not loading correctly anymore(no slider shown)
This is the html code:

<div class="topslider" style="margin-top: 80px;">
    <div id="slider">
        <div class="fullwidthbanner-container">
            <div id="revolution-slider">
                <ul>
                    @foreach($sliders as $slider)
                        @if($slider->type == 'video' && $slider->video && File::exists($slider->video))
                        <li {{-- data-transition="fade" data-slotamount="7" data-masterspeed="5000" --}}>
                            <video poster="" id="bgvid" playsinline="" autoplay="" muted="" loop="">
                                <source src="{{ asset($slider->video)}}" alt="" type="video/mp4">
                            </video>
                           {{--  <video src="{{ asset($slider->video)}}" type="video/mp4" playsinline autoplay muted loop> </video>  --}}
                            
                        </li> 
                        @endif
                    @endforeach
                </ul>
            </div>
        </div>

        <div class="tp-bullets">
            <div class="simplebullets round bullet">
                
            </div>
            
        </div>
    </div>
</div>

And finally this my website url

I get this error in my console:"Uncaught TypeError: Cannot read property 'nextElementSibling' of null"

1

There are 1 best solutions below

11
On

The standard .htaccess which comes with Laravel 5.4 is

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

    RewriteEngine On

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

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

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

Try to replace your .htaccess file in public/.htaccess with this contents.

Content copied from https://github.com/laravel/laravel/blob/5.4/public/.htaccess