Redirect URL in Apache

I have am running a website with a URL of say www.abc123.com/books.  How do I configure Apache to redirect www.abc123.com to www.abc123.com/books?
shannon_adamsAsked:
Who is Participating?
 
Sida SayConnect With a Mentor Infrastructure EngineerCommented:
You can use  .htaccess file an Apache server configuration file.
.htaccess:
Redirect 301 / http://www.abc123.com/books/

Open in new window


If you uploaded .htaccess file to the old-page.html directory and the redirection does not work, it usually means that the .htaccess files are not enabled in the Apache server configuration file httpd.conf.

httpd.conf:
<Directory /srv/www/rapidtables.com/public_html/web/dev/redirect>
   AllowOverride All
</Directory>

Open in new window

0
All Courses

From novice to tech pro — start learning today.