Redirecting non-www subfolder domain to www on wordpress multisite

244
January 26, 2017, at 06:20 AM

I currently have a multisite built in wordpress. The domain is set up to be:

http://www.domain.com

The microsites are set up and built out as:

http://www.domain.com/location-name 

My issues are with the non-www domains. If you go to

http://domain.com/location-name/ or http://domain.com/location-name/about 

it redirects to http://www.domain.com

I need it to redirect to http://www.domain.com/location-name/ or http://www.domain.com/location-name/about

Answer 1

You can use this to force www using your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Make sure you clear your cache before testing this.

READ ALSO
return statement not return any value in php function

return statement not return any value in php function

Can someone tell me why my return statement is not return any value in data[0] however if i choose to echo it, it shows that there is a value in data[0] but wouldn't work with the return statement

410
How make output from database in excel file

How make output from database in excel file

who can make output from database(on host) as excel filexlsx ?? I'am try some codes but the file after download not work :/ must download lib for it? help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

269
utf-8 do not work in all

utf-8 do not work in all

I am working on web site in phpEverything was good, already created 13 different pages but on next have a problem with some character

357
Decrypt Laravel Password Reset Token

Decrypt Laravel Password Reset Token

I am writing a test that ensures that the password reset functionality of my application worksThe password reset system was created using the php artisan make:auth command

636