1

I'm working on a small site and I've got a question. How can I remove the /public and the singular name from url? However for the entries I want to keep the first segment.

How do I do that? Because when I try to rewrite it in the htaccess the assets break (images etc)

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • Titles should be specific enough to identify the individual question, not just the topic. I've tried to edit that appropriately here. – Charles Duffy Jan 05 '17 at 19:04
  • Hi, i'm having the same problem and i found this guide with several ways to solve the problem: https://docs.bolt.cm/3.4/howto/troubleshooting-outside-webroot – sunyata Jan 16 '17 at 00:28

3 Answers3

1

You need to point your server to the /public directory. Here is what the official documentation is saying:

Only the 'public' folder needs to be accessible in the browser. After the first installation this folder is named public/ but as you read on, you will see that you can rename it to www/ or whatever your web server requires. To do this, configure your webserver to use the public/ folder as the web root. For more information about this, see the pages on configuring Apache or Nginx.

Source: https://docs.bolt.cm/3.2/installation/install-command-line

The directive for Apaches VirtualHost is (in your example domaincom.conf in /etc/apache/sites-enabled:

<VirtualHost *:80>
  DocumentRoot /your-bolt-directory/public
</VirtualHost>

And for Nginx:

location / {
    root /your-bolt-directory/public;
}
mcbetz
  • 2,329
  • 4
  • 20
  • 30
  • Regarding Nginx, root must be declared once on "server", or inside of every location that exists because of Bolt. [Pitfalls and Common Mistakes | NGINX](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#root-inside-location-block) – Alan Delval Mar 20 '17 at 15:01
0

The public part of the url should not be visible if you have your Apache virtualhost setup correctly.

Ordinarily, all you need to do here is point the DocumentRoot setting to the public directory, so for example if your setup currently looks like this: DocumentRoot /home/mysite

You adjust it to: DocumentRoot /home/mysite/public

You may also need to do the same for any <Directory /home/mysite > commands that are in your config too.

Once you have amended, restart Apache and http://yourdomain.com/ should load up the homepage and http://yourdomain.com/bolt take you to the backend.

Ross Riley
  • 826
  • 5
  • 8
0

Use .htaccess file to rewrite your URL's:

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/page [L] </IfModule>

n1kkou
  • 3,096
  • 2
  • 21
  • 32