[CentOS] CentOS 6.8 Apache-2.2.15-53 re-write question

Always Learning centos at u68.u22.net
Sun May 29 16:33:34 UTC 2016

On Sat, 2016-05-28 at 13:03 -0600, Paul R. Ganci wrote:


How about

	RewriteEngine on
	RewriteCond %{REQUEST_URI} !^/test/             [NC]
	RewriteCond %{REQUEST_URI} !^/my-folder/        [NC]
	RewriteRule ^(.*)$ http://www.newdomain.com/$1  [R=301,L]


	RedirectMatch 301 ^/test/(.*)$        /test2/$1
	RedirectMatch 301 ^/my-folder/(.*)$   /my-folder2/$1
	RedirectMatch 301 ^(.*)$              http://new.domain.com/$1


	RedirectMatch 301 ^/usual-directories-names-prefix/(.*)$

For many years the practise of using the 'www' prefix has been
depreciated by using just the domain name but also having a DNS A record
for the www for those that love the 'www' prefix.

Having a directory names prefix helps enormously when maintaining
multiple web sites.

Many web sites have a confused illogical jumble of directory names, and
many of those are far too long. Good planing before going live will
subsequently save lots of time and effort. Keep the public directory
structure plain, simple and logical. One never ever needs URL's
exceeding 80 characters.

Avoid things like this




If anyone has to type-in one of your URLs they will definitely
appreciate short URLs where there is less chance of making spelling


England, EU.      England's place is in the European Union.

More information about the CentOS mailing list