1

I've been trying for a few hours now to set up a non-www to www redirect on IIS 8.5 and am failing miserably. I am able to get the home page to force www but all other pages fail. I'm not really an IIS user so this is the first time I have had to do this. So far I have the following:

<rule name="Redirect domain.com to www" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="domain.co.uk$" />
    </conditions>
    <action type="Redirect" url="https://www.domain.co.uk/{R:0}" />
</rule>

I have also tried the below rule from OStraining without any luck.

<rule name="Redirect domain.com to www" patternSyntax="Wildcard" stopProcessing="true">
    <match url="*" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^domain.co.uk$" />
    </conditions>
    <action type="Redirect" url="https://www.domain.co.uk/{R:0}" />
</rule>

Can any one assist or shed any light on this?

  • If you look at the configuration.php file in the Joomla folder, what value do you have for Livesite ? – Irata Jun 14 at 8:06
0

After a lot of messing about with the web.config file I had a look around for a plugin that could force the redirect for me. This would not be my normal route, but as an IIS novice (as well as being completely baffled why a large corporation would choose to host Joomla on a windows server) I found the plugin below.

https://extensions.joomla.org/extension/www-redirect/

Again, I would never normally go down this route, but without another option, the plugin did the job. Hopefully this may help others in the future (as a last resort I hope).

Regards D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.