How to deploy to live server? (urgent)

Post Reply
User avatar
RobinSlee
Jr. Bludit
Posts: 5
Joined: Sat Aug 04, 2018 7:53 am

Hi. I have my local installation (using uWamp for development) But I want to deploy the site to the live server. I do not seem to be able to make it run outside of the bludit-2-3-4 sub directory.

I have copied all files to the root directory wwwroot and changed the reference in the .htaccess to rewritebase / and the line 19 in the site.php file under the bl-content/databases folder to end ain a trailing slash.

But it wont load. If i deploy the entire bludit-2-3-4 folder, and navigate directly to that then it works as expected. But when I go to the root via the normal domain url then it gives me a 403 error.

I have tried creating a .htaccess file under root to redirect to the sub folder, but that does not seem to do anything.

Any suggestions? I know I am missing something obvious. Any help would be greatly appreciated. Thank you.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

It should work if you copy the content of the directory /bludit-2-3-4 to the root directory.

If the installation is in the root directory .htaccess should be as it is in the distribution package:

Code: Select all

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]

# Base directory
RewriteBase /

# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

</IfModule>
After the migration you can set the "Site URL" at "Settings" > "Advanced".

If this does not work you can PM me, and I will have a look at it.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
RobinSlee
Jr. Bludit
Posts: 5
Joined: Sat Aug 04, 2018 7:53 am

HI, Thank you for the response. I will have to leave it for this evening as it is work in the morning! But, I will try again over the next day or two. Interestingly, I noted that the .htaccess that came in my build is different to what you have posted above. My looks like this:

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

# Base directory
RewriteBase /bludit-2-3-4/

# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

</IfModule>
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Sorry, the original distribution is:

Code: Select all

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>

# Enable rewrite rules
RewriteEngine on

# Base directory
#RewriteBase /

# Deny direct access to .txt files
RewriteRule ^bl-content/(.*)\.txt$ - [R=404,L]

# All URL process by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]

</IfModule>
The following is an addition and forces http requests to https:

Code: Select all

RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]
Please try with the following:

Code: Select all

# Base directory
RewriteBase /
instead of

Code: Select all

# Base directory
RewriteBase /bludit-2-3-4/
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
RobinSlee
Jr. Bludit
Posts: 5
Joined: Sat Aug 04, 2018 7:53 am

So I tried as described. Copied all files to root, set the base to just a forwards slash, and the index page loads. But when I click on a tag or category link it says 404 not found.

I am on shared hosting, with a redirect from my domain name to my wwwroot folder. But this has worked before and still redirects correctly otherwise index.php wouldn’t get found, right?

I did try a quick install directly on the server, but got folder not writable errors, so I had to stop there for the day and roll back.

I work long night shifts so only get to try quick tasks before work each day! Has anyone else managed to copy a dev folder to live without issue? I’m sure it’s just a config issue, but I only get small windows to play ;-)

Thanks for any help.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

You can PM me.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply