FEATURE #1530: make urls without /public
This change consist in renaming server.php to index.php, tweaking /.htaccess and replacing all asset('../resources....') with asset('resource/...') path. Everything should work fine now.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)/$ /$1 [L,R=301]
|
||||
|
||||
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [L]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_URI} !^/public/
|
||||
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]
|
||||
|
||||
#disable viewing all hiden files
|
||||
RedirectMatch 403 /\..*$
|
||||
+3
-3
@@ -254,17 +254,17 @@ Route::group([
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
|
||||
Route::get('', 'Visitor\Homepage@getIndex')
|
||||
Route::get('/', 'Visitor\Homepage@getIndex')
|
||||
->name('page.index');
|
||||
|
||||
// display login form
|
||||
Route::get('login', function () {
|
||||
Route::get('admin/login', function () {
|
||||
return view('admin.loginForm.form');
|
||||
})
|
||||
->name('loginForm');
|
||||
|
||||
// handle login
|
||||
Route::post('login', 'Admin\Login@postLogin')
|
||||
Route::post('admin/login', 'Admin\Login@postLogin')
|
||||
->name('login');
|
||||
|
||||
// route for all content pages. This rule must be specified last (because it matches every route)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</form>
|
||||
|
||||
@section('javascripts')
|
||||
<script src="{{asset('../resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
CKEDITOR.replace ('pageContent');
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</form>
|
||||
|
||||
@section('javascripts')
|
||||
<script src="{{asset('../resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
CKEDITOR.replace ('pageContent');
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
@stop
|
||||
|
||||
@section('head_stylesheets')
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/js/vendor/highlightjs/style/default.css')}}">
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/js/vendor/highlightjs/style/default.css')}}">
|
||||
@stop
|
||||
|
||||
@section('javascripts')
|
||||
|
||||
<script type="text/javascript" src="{{asset('../resources/assets/js/vendor/highlightjs/highlight.min.js')}}"></script>
|
||||
<script type="text/javascript" src="{{asset('/resources/assets/js/vendor/highlightjs/highlight.min.js')}}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('admin/common.admin')) | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
</head>
|
||||
<body class="admin">
|
||||
@@ -51,10 +51,10 @@
|
||||
© {{$pageName}} {{date('Y')}}
|
||||
</footer>
|
||||
</div>
|
||||
<script src="{{asset('../resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('../resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('../resources/assets/js/foundation.min.js')}}"></script>
|
||||
<script src="{{asset('../resources/assets/js/app.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/foundation.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/app.js')}}"></script>
|
||||
|
||||
@yield('javascripts')
|
||||
</body>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@lang('admin/loginForm.login') | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{asset('../resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('../resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('../resources/assets/js/foundation.min.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/foundation.min.js')}}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,7 +5,7 @@
|
||||
</div>
|
||||
|
||||
@section('javascripts')
|
||||
<script src="{{asset('../resources/assets/js/vendor/ace/ace.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/vendor/ace/ace.js')}}"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
var editor = ace.edit("{{$name}}Editor");
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('visitor/common.welcome')) | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('visitor/common.welcome')) | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
|
||||
<style>
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('visitor/common.welcome')) | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('visitor/common.welcome')) | {{$pageName}}</title>
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('../resources/assets/css/admin.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
|
||||
|
||||
Reference in New Issue
Block a user