1
htaccess 301 sub folder
CGuild1.com > Tips & Tricks > htaccess 301 sub folder

htaccess 301 Redirect

Here's an easy way to simply redirect an entire folder to a new URL.
  1. Open your .htaccess File to edit
  2. Make sure you have turned your rewrite engine on.
    RewriteEngine On #This needs to appear above the RewriteRule
  3. Upload your .htaccess file to the root on your server


RewriteRule ^oldurl/(.*)$ /new-url/ [R=301,NC,L]

A completed version should be similar to this:

RewriteEngine On
RewriteRule ^oldurl/(.*)$ /new-url/ [R=301,NC,L]
©2024 CGuild1.com