[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

Using htaccess how can I redirect users linked to old downloads to my download system

How do I setup an htaccess file to redirect users who are seeking a file to my new download system?

I tried using the command
Redirect 301 /file.rar http://forums.example.com/forumdisplay.php?f=39

Which works fine for domains and subdomains like
http://downloads.example.com/
but won't work for folders after the domain setup like
http://www.example.com/downloads/file.rar

Can anyone give me an idea on what I need to change?
0
jer2eydevil88
Asked:
jer2eydevil88
  • 2
  • 2
1 Solution
 
rivusglobalCommented:
Assuming you have the Apache Mod-Rewrite module enabled...

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.example.com/downloads/$1 [R=301,L]

Store the .htaccess file in your http://downloads.example.com/ root
0
 
jer2eydevil88Author Commented:
The files are located at http://www.example.com/downloads/

I want to redirect them to http://forums.example.com/?=item

The example you gave me seems to place the htaccess file in the wrong place
0
 
rivusglobalCommented:
sry jer,

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://forums.example.com/$1 [R=301,L]

Store the .htaccess file in your http://www.example.com/downloads root
0
 
jer2eydevil88Author Commented:
Thanks that worked great for me :-D
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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