1
votes

I'm actually using php to send a "301 Moved Permanently" header and redirects users to a easy-read address:

www.mywebsite.com to www.mywebsite.com/home

is there a way to do that with Apache ?

  1. User is requesting a url

  2. Server reads the .htaccess file and prepares the right page ( /mywebsite/home/index.html instead of /mywebsite/index.html )

  3. It sends the page and appropriate headers used to warn the browser that the new URL is www.mywebsite.com/home (not to use any JavaScript)

1
If I understand what you want to do, you need something like this: RewriteRule ^/$ /home [L,R=301] ;)Fabio Cicerchia

1 Answers

1
votes

With the time and experience growing, I can answer my own question, Hope this will help users that begin with apache :

RewriteEngine on
RewriteRule ^$ /home [R=301,L]