• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 425
  • Last Modified:

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?
0
awarraic
Asked:
awarraic
1 Solution
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now