Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6101

Redirect does not work as expected when the route has some path

$
0
0

I want to redirect all traffic from my blog.oldsite.com to blog.newsite.com

eg:

  • blog.oldsite.com => blog.newsite.com
  • blog.oldsite.com/page1 => blog.newsite.com/page1

I have followed this document:

Added the highlighted section:

sudo vim /etc/apache2/sites-available/000-default.conf

enter image description here

And then added the following line to:

sudo vim /var/www/html/.htaccess

enter image description here

And finally under my old site directory: /var/www/blog.oldsite.com

sudo vim .htaccess

Added the highlighted section:

enter image description here

Now I correctly get the following redirect:

  • blog.oldsite.com => blog.newsite.com

But the following requested is not redirected:

  • blog.oldsite.com/page1 => blog.oldsite.com/page1

Not sure why the paths are not getting redirected correctly?


Viewing all articles
Browse latest Browse all 6101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>