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

htaccess redirect wildcard

I have an old site that is indexed in Google and would like anything that was under the path below to redirect:

oldsite.com/NewsEvents/PressReleasesdetail/

(so for example there were several pages under this path like:)

oldsite.com/NewsEvents/PressReleasesdetail/tabid/348/Default.aspx
oldsite.com/NewsEvents/PressReleasesdetail/tabid/347/Default.aspx
oldsite.com/NewsEvents/PressReleasesdetail/tabid/302/Default.aspx

to now go to:

newsite.com/news-and-events/press-releases

how would I do this with htaccess?

0
danomatic
Asked:
danomatic
  • 2
  • 2
1 Solution
 
hernst42Commented:
place the .htacces in the document root of oldsite.com and try:

RewriteEngine On
RewriteBase /
^NewsEvents/PressReleasesdetail/tabid/.* http://newsite.com/news-and-events/press-releases  [R]

So everything requested under
oldsite.com/NewsEvents/PressReleasesdetail/tabid/ is redirected to the new site at http://newsite.com/news-and-events/press-releases
0
 
danomaticAuthor Commented:
This won't work because the old site is windows server and does not have htaccess.  

I should have clarified this, the old site and the new site have the same domain name, it's just that all the links changed. sorry about that. We moved from windows dot net nuke to PHP / MYSQL Joomla.

so I think I am looking to do something like a 301 redirect within the htaccess of the current site.
0
 
hernst42Commented:
You can use a RewriteEngine for IIS like
http://www.nabble.com/IIS-Rewriting-with-free-rewrite-engine-t4594958.html
Or google for "IIS rewrite engine" and use a suiteable one.
0
 
danomaticAuthor Commented:
I was able to do this:
RedirectMatch 301 ^/NewsEvents/(.*) http:// domian.com/news-and-events/press-releases

this way whatever was under NewsEvents goes to the new page
0
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

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