Welcome Guest, Not a member yet? Register   Sign In
Config base url with "/~someword"
#1

[eluser]FuturShoc[/eluser]
I'm setting up a QA server for testing before rolling out our CI application to production.
I can't really give the site a true URL, so I was thinking I could just put it on a url like this:

http://192.168.1.1/~qaserver

My problem is, CI doesn't seem to recognize the last segment and interprets the base url as:

http://192.168.1.1/

Is there a fix or workaround for this?
#2

[eluser]PravinS[/eluser]
Are you getting any error when you use ~ in base url?

also check "$config['permitted_uri_chars']" in your config file and check where ~ character is permitted or not.


#3

[eluser]FuturShoc[/eluser]
The tilde character IS listed in the permitted characters config item.

It does throw a server error:

"The server can not find the requested page:"
#4

[eluser]FuturShoc[/eluser]
Does anyone have additional input?
#5

[eluser]fogcity[/eluser]
[quote author="FuturShoc" date="1371480921"]Does anyone have additional input?[/quote]

My additional input is that it's happening to me too.

Cannot test the site on new server because it's got a tilde in the base url... ugh
#6

[eluser]fogcity[/eluser]
[quote author="PravinS" date="1371187027"]Are you getting any error when you use ~ in base url?

also check "$config['permitted_uri_chars']" in your config file and check where ~ character is permitted or not.


[/quote]

I'm seeing this same problem and I've tried to allow tildes in URLs as follows:


Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\\-~';

Still not working.
#7

[eluser]_Val[/eluser]
Create a whatever.php file in that "directory" with this content
Code:
<?php
if (isset($_SERVER['HTTP_HOST'])) {
$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
$base_url .= '://'. $_SERVER['HTTP_HOST'];
$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
echo $base_url;
}
?>
and open it up in browser and you will see why...
Taken from /system/core/System.php
#8

[eluser]_Val[/eluser]
[quote author="PravinS" date="1371187027"]
also check "$config['permitted_uri_chars']" in your config file and check where ~ character is permitted or not.[/quote]
Stop writing this Smile Think out of CI.
#9

[eluser]jairoh_[/eluser]
so ~qaserver is the name of your project? if you keep this naming, you're prone to be fired if you have a job.




Theme © iAndrew 2016 - Forum software by © MyBB