Welcome! Log In Create A New Profile

Advanced

Moving Joomla from subdir to root -> rewrite / redirect problem

Johannes Rohr
December 15, 2017 09:28AM
Dear all,

in order to have prettier URLs I have decided to move my joomla from
/web/ to /, but I want old URLs to transparently redirect.

I am struggling how to do this.

First I though of something like

location /web {
  try_files $uri $uri/ /index.php?$args;
 }

but this obviously did not work as the arguments passed to index.php
still contain the /web/   part  , which would have to go.

So I tried instead:

location / {
    rewrite ^/web/(.*)$ /$1;
  try_files $uri $uri/ /index.php?$args;
}

thinking that the first line would modify the URI, taking away the /web/
part so that in the next line the changed uri would be fed to the
try_files command.

But this only resulted in 404s.

Can someone enlighten me on where I am going wrong with this?

Thanks a lot in advance,

Johannes

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Moving Joomla from subdir to root -> rewrite / redirect problem

Johannes Rohr December 15, 2017 09:28AM

Re: Moving Joomla from subdir to root -> rewrite / redirect problem

Francis Daly December 18, 2017 02:38PM

Re: Moving Joomla from subdir to root -> rewrite / redirect problem

Johannes Rohr December 22, 2017 02:00PM

Re: Moving Joomla from subdir to root -> rewrite / redirect problem

Francis Daly December 23, 2017 07:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready