[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]
or
RedirectMatch 301 ^/test/(.*)$ /test2/$1
RedirectMatch 301 ^/my-folder/(.*)$ /my-folder2/$1
RedirectMatch 301 ^(.*)$ http://new.domain.com/$1
or
RedirectMatch 301 ^/usual-directories-names-prefix/(.*)$
http://new.domain.com/new-directory-names-prefix$1
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
http://www/domain.com/public-communications/press-and-public/press-releases/press-release-12345-man-hits-dog-in-childrens-park.html
and
http://www.dailymail.co.uk/news/article-3615099/Outrage-directed-parents-Harambe-gorilla-s-senseless-death-four-year-old-son-fell-enclosure-led-zoo-officials-fatally-shoot-animal.html
If anyone has to type-in one of your URLs they will definitely
appreciate short URLs where there is less chance of making spelling
mistakes.
--
Regards,
Paul.
England, EU. England's place is in the European Union.
More information about the CentOS
mailing list