Redirecting a URL

Server info:
Sun Solaris 10

Hi, I had a directory name change on my server, let's see from a folder name ABC to DEF

I placed a redirect on the server something like:
Redirect FROM(ABC) TO(DEF)

Issue that I am facing is, every sub folder and sub page gets redirect to the DEF folder.
For example,

"http://xxx.com/ABC/hours.html" gets redirect to
"http://xxx.com/DEF/"

Is there any way/syntax to just replace ABC with DEF and the server 'd render the rest of the URL as it is. For example:
"http://xxx.com/ABC/hours.html" redirect to
"http://xxx.com/DEF/hours.html"

It's not just for one page, I am trying to find a way to do that for "ENTIRE" folder so that I don't have to put redirects for each page separately.

Any thoughts? ideas?
awarraicAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

szlampCommented:
Yes, is your server running the mod-rewrite module? If so this shpuld be relatively simple if I have understood your problem correctly.

Create a .htaccess file in your root web folder with the following entries.

RewriteEngine on
RewriteRule ^/ABC/(.*)$ /DEF/$1

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
arober11Commented:
Alternatively you could add an Alias to your httpd.conf (see: http://httpd.apache.org/docs/2.2/mod/mod_alias.html) e.g.

Alias /ABC/  /var/web/htdocs/DEF/

Or add a symbolic link in the root directory e.g.

ln -s DEF ABC

Note: Make sure you have a ' FollowSymLinks'  in the respective Directory Options block.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.