Welcome Guest, Not a member yet? Register   Sign In
I want both www and non-www to work !
#1

(This post was last modified: 03-21-2015, 07:46 AM by invader7.)

Hello forum , i need your help about my codeigniter site.

I have an iOS application which makes a POST request to my site with www

example : http://www.mysite....

The response is 301 moved permanently and i can never get the POST data.

If i make the POST request to non-www

example : http://mysite...

Everything works fine !


So here is my current configuration

system/application/config/config.php

Code:
$config['base_url'] = 'http://mysite.....';
$config['base_url_static'] = 'http://mysite.....';
$config['base_url_videos'] = 'http://mysite.....';

.htaccess

Code:
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1


and my apache virtualhost configuration file

sites-available/mysite.com


Code:
<VirtualHost *:80 >
       ServerName www.mysite.com
       ServerAlias www.mysite.com
</VirtualHost>

any ideas ??

Thanks !!
Reply


Messages In This Thread
I want both www and non-www to work ! - by invader7 - 03-21-2015, 07:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB