Welcome Guest, Not a member yet? Register   Sign In
Name of project in prod url
#1

(This post was last modified: 01-21-2017, 10:51 AM by krislec.)

Hi

My project is http://localhost/project
and I would like to have the name of the project in production url

How can I make this work ?

.htaccess
Code:
   RewriteEngine On
   RewriteBase /project/

config.php
PHP Code:
$config['base_url'] = 'http://X.X.X.X/project/'

This configuration doesn't works.
Any idea ? is it possible ?

Why a configuration like this ? Because I have some javascript files like list:
Code:
              // Définition des variables selon la page
               var pathArray = window.location.pathname.split( '/' );
               var uri_1 = pathArray[2];
who's works fine in localhost but can't works in prod because the name of project is not in the url...
Reply
#2

I did it myself !

I replace my javascript like this :
Code:
                // Définition des variables selon la page
                var pathArray = window.location.pathname.split( '/' );
                // Définition selon pathArray[0] => dev (localhost) ou  prod (10.0.0.10 => absence du nom du projet donc -1)
                // En DEV : http//localhost/meduse/controller
                // En PROD : http//10.0.0.10/controller
                var uri_1 = pathArray[0] == 'localhost' ? pathArray[2] : pathArray[1];
Reply




Theme © iAndrew 2016 - Forum software by © MyBB