0

The url is something like this

site.com/#/fr/welcome/

I want to rewrite (and remove) in the url the /fr/ part without affecting anything else

the /fr/ and /welcome/ aren't actual folders in the first place. The developers at my place at currently using Angular.

I'm at a loss as to what to do, I've actually searched similar threads, but everything in these threads either doesn't do anything or the page fails to load.

Anyone can help? Thanks

Here's my current Nginx config:

server {


 listen 80;

server_name www.site.co site.co;
root /home/forge/site.co/public;

# FORGE SSL (DO NOT REMOVE!)
# ssl_certificate;
# ssl_certificate_key;

index index.html index.htm index.php;

charset utf-8;

if (!-d $request_filename) {
    rewrite ^/(.+)/$ /$1 permanent;
}

location / {
    try_files $uri $uri/ /fr/index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log on;
error_log  /var/log/nginx/site.co-error.log error;

error_page 404 /index.php;
ItalyPaleAle
  • 7,185
  • 6
  • 42
  • 69
FLalex
  • 3
  • 2

1 Answers1

0

There is nothing you can do in nginx about this, since the browser does not send data after the hashbang to the server.

See: How to get Url Hash (#) from server side

Community
  • 1
  • 1
naeramarth7
  • 6,030
  • 1
  • 22
  • 26