Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 472 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Laravel 4 removing public from URL

#11
**I'm using L5, This works for me fine:**

1. Rename the server.php in the your Laravel root folder to index.php
2. copy the .htaccess file from /public directory to your Laravel root folder.

-- Thatz it!!!
Reply

#12
Go to project folder using cmd and type "php artisan serve".
Now navigate to: localhost:8000
Reply

#13
I have found geart flow to work with laravel localy.

What you can do is to configure xampp a bit. At your xamp's httpd.conf file you have to find document `DocumentRoot` and `<Directory>`. Change root directory to yours laravel public folder and restart apache. Since when you can access your project simplly just typing localhost. Now if you want you can change your host file and rewrite local dns, for example: 127.0.0.1 `example.laravel.com` and now you can access your project with real url. It may look bit complicated, but it's not.

Alternative to that would be `php artisan serve`. You can start server on different ports and when re-write hosts file.

You could add some features to improve your workflow even more, for example `vagrant` or `ngrok`. You can share your project for live presentation (speed may be issue here).
Reply

#14
Need to remove public segment in the larvel4 app

Laravel 4 requires you to put your app code one level higher than the web root, and this causes problems for some developers that are stuck on shared hosting and that doesn’t allow a setup like this. It’s actually really easy to get around it. I read that some L4 specific packages could have problems on a setup like this, but I didn’t experience anything like that with any package yet.

So first install L4 somewhere you like. I liked the article Niall wrote on keeping the base L4 app up to date, so go and check that out: Installing and Updating Laravel 4

I find it’s enough for this example to simply clone the repo (assuming you have composer installed globally, if not, go to

[To see links please register here]

):

git clone -b develop git://github.com/laravel/laravel.git app_name
php composer install

Note that we are cloning the develop branch since L4 is still in beta at this time.

So to remove the “public” part from your URL, simply move all files and folders from public to your app root and you’ll end up with a folder structure like this:


/app
/bootstrap
/packages (copied from /public)
/vendor
.htaccess (copied from /public)
artisan
composer.json
favicon.ico (copied from /public)
index.php (copied from /public)
robots.txt (copied from /public)
server.php

Now we need to edit our paths in index.php:

require __DIR__.'/bootstrap/autoload.php';

$app = require_once __DIR__.'/bootstrap/start.php';

And then just set the public dir in out /bootstrap/paths.php file:


'public' => __DIR__.'/..',

this is my suggession
Reply

#15
You need to do following things:

1. first copy all the contents of the public directory in your root directory i.e. bring the contents of public folder 1 step up.

2. modify the contents of index.php


From =>

require __DIR__ . "/../bootstrap/autoload";
$app = require_once __DIR__ . "/../boostrap/start.php"


To =>

"require __DIR__.'/bootstrap/autoload.php';"
"$app = require_once __DIR__.'/bootstrap/start.php';
and also contents of bootstrap/paths.php<br>

From => `'public' => __DIR__.'/../../',`

To => `'public' => __DIR__.'/..',`

3.Then finally create **.htaccess** file in your root directory and write this.

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Reply

#16
Simple Steps To follow:

1. Rename `server.php` (In Root directory) to `index.php`
2. Copy `.htaccess` file from public directory to root directory
Reply

#17
rename the `server.php` to `index.php` and copy `.htaccess` from `/public` is the right way.
If you send your app online,just change DocumentRoot to the path of public.
Reply

#18
just in simple step i did in laravel 5
make .htaccess like this in laravel folder

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

RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

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

then rename your `server.php` to `index.php`

that it it will work

or if you just doing local development

run this comman `php artisan serve`

it will start local server at `localhost:8000` (port may vary)

Reply

#19
if you remove public from url first of all move index.php and .htaccess file from public folder to root of the laravel and change in index.php file

require DIR.'/../bootstrap/autoload.php';
$app = require_once DIR.'/../bootstrap/start.php';

to

require DIR.'/bootstrap/autoload.php';
$app = require_once DIR.'/bootstrap/start.php';

and run the program
Reply

#20
This has been asked before many times. I had the same problem. I solved it by using vhosts and .htaccess files. I wanted to write about solution on both XAMPP on Windows and LAMP installation on Ubuntu. My configuration on windows:
My aim was to reach my application by entering the uri below

[To see links please register here]


c:\xampp\htdocs\subdir\ # this was laravel root directory
c:\xampp\apache\conf\extra\httpd-vhosts.conf # this virtual hosts file

I used original .htaccess file from Laravel website (and remember .htaccess file must be in public directory) but I just added one line which is

RewriteBase /subdir (just below RewriteEngine On)

In addition, in httpd-vhosts file you should add your subdirectory alias like that:

Alias /subdir
"C:/xampp/htdocs/subdir/public"
<Directory "C:/xampp/htdocs/subdir/public">
Order allow,deny
Allow from all
Options All
AllowOverride All
Require all granted
</Directory>

Hope everything is clear with my explanation. This answer can be applied on unix based systems easily.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through