0

Lets say I've got a site example.com/books/linux

I want to rewrite the url to books.example.com/linux without doing anything else (without redirecting/moving files to a different location on a server etc.).

So how can I just rewrite the url using apache2?

I would be glad to read your answers. Thank you very much!

  • When you enter "example.com/linux" as a url, you could setup a redirect page which would take you to the actual location. I.e: "example.com/books/linux". – Ballard Sep 10 '17 at 10:54
  • OR, check this thread out: https://stackoverflow.com/questions/18973058/how-to-remove-folder-name-from-url-using-htaccess – Ballard Sep 10 '17 at 10:54
  • It should be just like alias. So when I open example.com/books/linux it goes to book.example.com/linux (different domain name) and the other way around. It should serve the same files from the same location on the filesystem. As I understand redirect will throw me to a different location. – Sammy Jenkins Sep 10 '17 at 11:04
  • In that case, I believe you should refer to the first answer on the thread I linked – Ballard Sep 10 '17 at 11:06

0 Answers0