Welcome Guest, Not a member yet? Register   Sign In
how to hide server side language on a CI site?
#1

[eluser]stef25[/eluser]
Client wants to hide which server side technology we are using. index.php is being removed from the url, but he rightly suggested that if some one adds index.php at the end of the url, some sort of page still loads (albeit with broken paths, etc) so the technology is revealed.

is it possible to generate a 404 or some kind of error page if (isset($this->url->segment(5))) ? im using segments 3 and 4 only, so anything additional should give an error.

How does one usually answer a valid question from a client like this?
#2

[eluser]xwero[/eluser]
Are you saying if you use .htaccess to hide index.php he is still able to get some error message when he enters an url like http://site.com/controller/method/index.php?
#3

[eluser]stef25[/eluser]
well ... i havent actually removed the index.php yet. im having problems with the .htaccess samples provided in the user guide and another example i found on the forums. ill try solve this first, i'd imagine it shouldnt be too hard.

are you saying that once i get that to work then the problem should be solved?
#4

[eluser]xwero[/eluser]
It should get you and 404 error message.
#5

[eluser]zdknudsen[/eluser]
You could also add an url suffix in your config file (e.g. ".html") to further obscurify that you're using PHP.
#6

[eluser]stef25[/eluser]
i added that in my config file (see below) but its not doing this either. my url is below. 123 can be any number and "en" is the language. it would be really nice if i could get en.html at the end - what is needed to get this to work?

example url:
domain.com/mailer/index/123/en

config:
$config['url_suffix'] = "html";
#7

[eluser]zdknudsen[/eluser]
All this feature does, is allow urls like domain.com/mailer/index/123/en.html (or whatever suffix you've chosen) to not return a 404 error. The standard urls will still work.

You have to manually add .html to all your links (or use the codeigniter helpers that create links, which will automaticly add base_url, suffix, etc.).
#8

[eluser]stef25[/eluser]
since im using if(segment(4)) = 'en'{show the english text;}, this is no longer working with en.html. if i change the condition to en.html, i get the same problem - no text is shown. is that normal?
#9

[eluser]Vince Stross[/eluser]
your config file setting should read

Code:
$config['url_suffix']=".html";

you forgot the period before "html"

Don't know if that will fix or not.

Also, it may be a huge job for you - depending on how large your app is - but I've noticed that the best way to be sure everything works in a large CI site is to generate ALL urls using the URL helpers.

As Zacharias mentioned: base_url(), site_url('/controller/method/en/'.$var1), etc...

You may already be doing this but I wanted to be sure to reiterate that it is the best way to be sure you have good URLs throughout. It will automagically add the $config['url_prefix'] value also so don't do that yourself when using the helpers.
#10

[eluser]stef25[/eluser]
well spotted and that fixed it, thanks! it's a very small 1 page microsite, no need for URL helper. thanks for all the help




Theme © iAndrew 2016 - Forum software by © MyBB