Silverstripe install root folder public - silverstripe

I have installed silverstripe 4 into the /var/www/html folder in apache.
However, when I go to the url, I have to use "localhost/public/index.php" in order to obtain the main page. I thought I was to be able to just go to "localhost" to find the defaut page. What am I to do if I want to have a main page without people having to specify "/public/" before it?
Thanks.

Normally, your localhost website can be resolved without adding /public/ if the following 2 things are configured correctly.
Enable Apache mod_rewrite
Having .htaccess rewrite config in /var/www/html
Troubleshooting
Check if you got the right .htaccess in /var/www/html. Basically, this Apache config file will forward all the requests to /public/ folder.
If .htaccess is fine, make sure your mod_rewrite is enabled in your Apache. Check this link.

Related

OpenLiteSpeed WordPress VPS 404 Error on Non-Wordpress Site Install in Sub Folder

I have an OpenLiteSpeed VPS WordPress install over at Vultr, and am trying to install a non-WordPress website into a sub-folder I created.
Ex.) https://example.com/test that is pointed to a new folder I created in the WordPress root install directory of /var/www/html/test
I created the directory and placed the files needed there that include an index.php file, however when I go to https://example.com/test, I receive a 404 Not Found error. I believe it has something to do with modifying the .htaccess file in the root of my WordPress install, but am unsure of what to modify 100%.
Any help is appreciated!
I tried modifying the Rewrite rules but am not confident in the options I chose. I since reverted the .htaccess file back to my default settings in which OpenLiteSpeed defines.
This can be closed out - I have it defined in my index.php file that resides in that folder point to a database I created in phpMyAdmin and I had the database field filled out incorrectly. Thank you to everyone who replied though. Oops!

Wordpress on Nginx server - .htaccess vs. nginx.conf

I have recently changed from Apache to Nginx server and running a Wordpress installation that was migrated onto this new Nginx server.
I only just realised that (the server provider forgot to mention) that the .htaccess file is no longer supported and shouldn't be used with Nginx.
Instead the nginx.conf file should be used. I know I can convert the contents of my current .htaccess file to nginx.conf using one of the convertors, but I don't even have the nginx.conf file.
Can I just create one?? And If I create one, do I place it into the root where currently my .htaccess file is??
Do I then delete the existing .htaccess file?
How should I go about this?
You definitely have nginx.conf - without it, your site wouldn't work. It is in /etc/nginx/ folder, and some additional configs can exist there and in subfolders.
Standard recommendations for WordPress with nginx you can find here in Codex. But if your site works, you have nothing else to do.
Unlike Apache with .htaccess files, nginx does not use any configuration files in WordPress folders. Everything is centralized in /etc/nginx/.
.htaccess files are ignored by nginx and can be deleted or kept in WordPress folders - it doesn't matter.
However, if you have some non-standard tuning in .htaccess files, you should implement relevant directives in nginx conf files. Convertors not very good for it, and produce errors sometimes, unfortunately. You should learn Apache rules used and create similar for nginx by yourself.

Using wordpress in a subdirectory

I use to have wordpress installed on the root of the website, but today I moved to a subdirectory "root/blog" with these steps:
1) Moved all the files>
2) Copied .htaccess and index.php do "root" and modify them
3) Change the wordpress URL on the settings.
It worked fine.
But I don't want it be accessed via www.mysite.com. I want to be access as www.mysite.com/blog. I want to do my own main index.
But if I remove the index.php from root, it gives me problems like /blog won't find my static first page.
What I'm missing?
You need to change your apache virtualhosts settings.
More infos here.

Migrating Drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.
You may need to disable clean URLs before exporting the database, try to add ?q= before each path.
That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.
Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.
With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.
Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

WAMP + directory alias + Drupal clean URLs

I have WAMP installed on my pc where I would like to run Drupal 6.
When I'm installing Drupal, I get the option to activate Clean URLs.
First I put my Drupal install in the www folder and I could choose to enable the clean URLs, but for backup reasons I moved it outside the www folder and created an alias the would point to the folder.
When I installed Drupal again, I couldn't choose to enable clean URLs anymore; the option was grayed out.
I would like to know why this happens; it seems some Apache module or PHP extension isn't available outside the www folder.
Just to be sure, I also tried an XAMPP install and created an alias with the some code lines as in the WAMP server but that worked, for some reason. The Apache version in WAMP isn't the same as the XAMPP install but I don't really think that is relevant.
I believe it's an config error in WAMP but I can't find out what.
Clean URLs doesn't work in the directory you copied Drupal because for that directory the directive AllowOverride is not set to All.
Drupal requires that every directives found in .htaccess files are enabled, in order to enable clean URLs; the directive AllowOverride, when set to All, allows to use all the directives that a .htaccess can contain.
The reason that in one case you can select the the option to enable the clean URLs, and in the other case is not selectable, is that Drupal, during its installation verifies the server is set to work with clean URLs, and change the form field to read-only if the server cannot support such feature.
To notice that the .htaccess file provided from Drupal can possibly need to be edited, in order to enable the clean URLs, as reported in the following comments, found inside the .htaccess file.
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

Resources