Jump to content

Windows server + PW 3.x (solved)


mel47
 Share

Recommended Posts

Hi,
I'm a little discouraged. The non-profit organisation for which I develop the website decided to move from a (bad) apache server to a windows server they have access for free. But I never worked with IIS, and I'm not sure how to pursue. I have for now 404 pages due to absence of rewrite.
For sure, I read this pivotal post from @matjazp with the attached web.config file. But it was in 2016, probably with PW 2.x. My question is : can I still use this file?
I'm on windows server 12 R2, PW 3.148, with procache (i guess the module the most related to rewrite rules).

Thanks
Mel

 

Link to comment
Share on other sites

As far as I know you don't have to use IIS, you can install apache, like XAMPP. But I can confirm PW will work on IIS as I'm on the same infrastructure as you are. I have a bit updated version of web.config here on my local test environment, but even web.config from 2016 should work. But you will need IIS rewrite module for sure. Let me know if I can assist further (like remote access via RDP or TW or anything).

  • Like 5
Link to comment
Share on other sites

Quote

The non-profit organisation for which I develop . . . moved to a windows server they have access for free . . .

First thing: does it really need to be a dedicated hosting ?
If not, no one from that non-profit organisation can afford 25 or 50 euro a year for a good shared hosting ?
(hostinger or bluehost)
I would do anything to avoid that frustrating and weird "MicroSoft" style windows IIS Server.

Link to comment
Share on other sites

4 minutes ago, pwired said:

I would do anything to avoid that frustrating and weird "MicroSoft" style windows IIS Server.

It could be frustrating and weird, as almost anything on the world... As I said, Apache can be installed if one is familiar with it 

  • Like 1
Link to comment
Share on other sites

Thanks for quick answer. Unfortunately I don't have control on those decisions, I even strongly suggested my hosting I used since years for my own PW's site, but it was not the final choice.

It works. For now I only discover a problem with date translation, related to setlocale, but couldn't find exactly what I should do. Still trying different version. I had fr_CA.UTF-8 in "C" translation.

Mélanie

Link to comment
Share on other sites

1 hour ago, mel47 said:

I had fr_CA.UTF-8 in "C" translation

This could be one of those weirdness pwired mentioned. Windows does not have fr_CA.UTF-8 locale. Please check this link: https://docs.moodle.org/dev/Table_of_locales Also be aware that the %e and %k modifiers are not supported in the Windows implementation of strftime() function. I use this on windows (found somewhere on the net):

function mydate($f, $d) {
    $f = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $f);
    $f = preg_replace('#(?<!%)((?:%%)*)%k#', '\1%#H', $f);
    return iconv("", "UTF-8", @strftime($f, $d));
};

and the use it like this (old fashion way):

if($lang === "en") $out .= "Publish date: " . mydate("%Y/%m/%d", $post->post_date);
else $out .= "Datum objave: " . mydate("%e. %B %Y", $post->post_date);

 

  • Like 1
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...