-5

What's the best way to do that?

Let's say once you login in your URL changes from domain.com to domain.com/modules/game/.

Is there any way I could change that to, let's say, domain.com/app?

I've tried with JS but it seems to make CSS and other JS scripts stop working for some reason (probably wrong paths?).

Damian Doman
  • 522
  • 8
  • 19
  • 1
    That would not make your app any safer. But you could use mod rewrite on an Apache server for aesthetic affect. – Dragonthoughts Feb 08 '18 at 22:17
  • By safer i meant that direct url to potentialy secret elements like admin panel php files wouldnt be visible, and also the aesthetic case would be solved. – Damian Doman Feb 08 '18 at 22:20
  • 8
    if all i need is the url, to arrive at parts of the site i shouldn't, then your doing things very wrong –  Feb 08 '18 at 22:23
  • Possible duplicate of [Modify the URL without reloading the page](https://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) – Damian Doman Feb 08 '18 at 22:30
  • 3
    The bottom line here is that all paths on the domain that are security sensitive should be secured. Security by obscurity is what you are asking for and it's not secure. – gforce301 Feb 08 '18 at 22:41
  • Edited title not to be misleading in terms of security anymore. I finally understood that security of connections should be checked serverside in case any possibly harmful scripts are run. – Damian Doman Feb 17 '18 at 20:24

1 Answers1

2

Changing the URL has absolutely nothing to do with security. Security trough obscurity is no security.

It is a better user experience though, so rewriting your url can be a good idea, and quite easy with something like .htaccess

Provided you have a RewriteEngine On somewhere in there, you should be able to just add something like this:

RewriteRule    ^app/(.+)$  modules/game/$1      [NC,L] 
Pevara
  • 14,242
  • 1
  • 34
  • 47