Jump to content

Install PW from devel machine to subfolder on shared web hosting


Recommended Posts

Posted

Hi,

I'm pretty sure this has been asked. many times before , but I can not find a solution to my problem, I need to show my friend how his site is going.

I'm developing on my Mac usign Mampro, I have published about two other PW sites without problems, always in the root folder

Whe I try to install this site to the "devel" folder in my friend's webhost, my assests are not working (css, images),
and can't access the backend.

The URL should be:

www.domain.com/devel

on my config.php

I have:

$config->httpHosts = array('domain.com', 'friends-admin');

I have copied over the .htaccess file

Any help will be greatly appreciated


 

 

 

 

Posted

Hi Sérgio,

I tried the

RewriteBase /devel/

But  I'm still my assests are failing to load.

I can access the backend, but the assests are failing there too.

Any clue?

Posted

How are you linking to the assets? Like the default

{$config->urls->templates}assets/

?

And can I see your .htaccess and config.php (remove the password, of course) ?

Posted

Sergio,

I'm using this to call my assets:

<link rel="stylesheet" href="<?= $config->urls->templates; ?>assets/plugins/bootstrap/css/bootstrap.min.css">

I need to install in the /devel/ folder.

I have changed the .htaccess file to txt

 

Thank you for your help.

config.php

htaccess.txt

Posted

One question, did you move the .htaccess to the devel folder?

I just tested a PW local installation here, running on MAMP:

1 - It was running under pw-multilang.dev with default config.:

Screen Shot 2016-07-25 at 19.20.45.png

My config.php has

$config->httpHosts = array('pw-multilang.dev', 'www.pw-multilang.dev');

2 - I created a 'devel' folder inside the folder and moved all files, including the .htaccess, to it. Checked http://pw-multilang.dev/devel/ and all good, assets loaded and all pages accessible, including admin.  

3 - I did another test, changed the base on .htaccess to /devel/ and all was good too. http://pw-multilang.dev/devel/ kept working.

----

Did you do anything else I didn't?

  • Like 1
Posted

Sergio,

If I put the .htaccess file on the root folder of the webhost  (Cpanel by the way) I get no assets

If a move the .htaccess file from the root folder to the /devel/ I get no assets and a 403 error on assets files.

 

I also tried to mimic the folder on my Mampro and everything is working fine too.

 

Posted

I suspect it's a CPanel config then. Can you create a subdomain like dev.domain.com and move the files there? 

Posted

This is driving me crazy.

I created a sub domain: dev.domain.com

Uploaded all files, uploaded .htaccess (with no edits, just the working .htaccess from Mampro), edited the config.php to:

$config->httpHosts = array('dev.domain.com');

With no success... :'(

 

Posted

Hum... you can remove the style and scripts folders inside templates/ as you are not using them. 

But if you have the css and js file inside 'assets', maybe the error is from using PHP shortcode syntax to echo the path on:

<?= $config->urls->templates; ?>assets/

Try using:

<?php echo $config->urls->templates; ?>assets/

 

  • Like 1
Posted

I have all the assets inside the template folder along with te template.php files.

I just tried:

<?php echo $config->urls->templates; ?>assets/

No luck.

The strange thing is that the PW backend is also loading without any assets, I'm gettin a unstiled backend.

Posted

Your templates folder has 777 permissions - some hosts don't like this and will throw errors.

And the permissions look a bit funny in general. For my sites all folders have 755 and all files have 644 (apart from config.php which is set to 400 for security reasons).

  • Like 3
Posted

Guys, It was a premissions problem.

I ended uploading everything using ftp, and now is working fine.

For some reason, when I packed the site using the Mac compress utility the permissions are screwed.

Anyway, Thank you Guys for the help.

 

  • Like 3

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...