Welcome Guest, Not a member yet? Register   Sign In
keep "www" in url

Hi !

I've got a problem with routing (once again).

Structure of my project :



In App.php

PHP Code:
public $baseURL 'https://www<my_domain>.com/';
$indexPage ''

I've set up my mutu server in order to point to "./www/public".

I put .htaccess from my public directory to "./www" and I've commented lines in order to keep "www" in urls. The reason is because I conclude that my mutu server only redirect url starting with "www" to "./www/public" and not the other ones. Therefore, when original .htaccess removes "www" from "www.<domain>.com" to "<domain>.com" and redirect, it shown my root directory "./www" because (I think) in that case the server don't do the redirection to "./www/public".

# Rewrite "www.example.com -> example.com"
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
# RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

With that config, my home page is working fine with url request like
  • <domain>.com                          => forbidden but it's not a problem for me
The problem is other url don't work except if there's an explicit "index.php" Is it causing by keeping "www" in urls ?
I've test with indexPage = "index.php" in App.php and it's working fine but url are ugly AND I've had same "file not found" results with "return redirect()->back();" command.

Thanks for the help !

This will show you how to do almost anything.

Stupid .htaccess Tricks
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB