Jump to content

Problem with URL generation


AmilcarMarques
 Share

Recommended Posts

Hi,

Sorry if this is too basic but it is becoming a big problem.

We had a PW 2.2 production site and we had to relocate it recently. Since then the generated absolute URLs are incorrect (one slash is missing) and some files are not accessed, like css files. For instance, in 

<link rel="stylesheet" type="text/css" href="http://knowledge4foot.eu/inga3dsite/templates/styles/main.css" />
 

 the slash between inga3d and site disappeared. 

However if I do a page view from the admin side, everything works fine because the generated URLs are relative  <link rel="stylesheet" type="text/css" href="/site/templates/styles/main.css" />

Can you help me?

Thanks,

Amilcar

Link to comment
Share on other sites

Welcome @AmilcarMarques,

do you have the absolute urls in your template files?

If yes, it is better to embed them using the $config->urls->templates method:

<link rel="stylesheet" type="text/css" href="<?=$config->urls->templates?>styles/main.css" />

This generates a relative path to your templates directory, similar to the one in admin side.

Regards, Andreas

  • Like 1
Link to comment
Share on other sites

Is inga3d a subfolder inside your PW installation containing an index.php?

If yes, it woud be better to create an dedicated template for this site and add an page in PW for it.

However you could try to either add ../ to your relative URL, to target the directory, above or ./ to target the root of this domain.

So for example: ./site/templates/

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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