Quantcast
Channel: enrii.blog » Software and tools
Viewing all articles
Browse latest Browse all 10

Redirect a Directory to New Location using .htaccess

$
0
0

After migrating system from temporary server to a new server, we will have to request all users to go to the new site.

I am not an expert in Apache rewrite rules, but finally found this way to redirect everything from a specific directory to a new location.

RedirectMatch 301 / http://blog.enrii.com

Save the file as .htaccess, then put the file into the folder you want to redirect (should be somewhere inside your htdocs folder). Replace http://blog.enrii.com with the new site that you want to redirect.

In case it doesn't work, see if the following line in httpd.conf is commented:

LoadModule rewrite_module modules/mod_rewrite.so

Un-comment it if necessary.

That's how I finally got it working. Please let me know if I am not doing it correctly.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images