Current location: Hot Scripts Forums » Other Discussions » Web Servers » Apache Redirects


Apache Redirects

Reply
  #1 (permalink)  
Old 07-17-09, 03:33 PM
=OTS=G-Man =OTS=G-Man is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Question Apache Redirects

Hello, I'm having an issue getting my redirect working and I think its just because Ive been looking at it too long.

Ok here it goes, I have 2 redirects going on because of the amount of domain names and old links coming to the different sites.

First heres the folder layout

in the root, we have the main site, then in a sub folder "/churchinstrumentalist.com" we host a separate site but it used to be just in "/churchinstrumentalist" so in the root folder the .htaccess is

Code:
RewriteEngine On
RewriteRule churchinstrumentalist/?(.*) http://www.churchinstrumentalist.com/$1 [R,NC]
*Home - Church Instrumentalist - Your source for Instromental Sheet Music is the new, main, domain that points to the /churchinstrumentalist.com folder

This seems to be working right, because heres an example URL

Code:
http://www.chandlermusic.com/churchinstrumentalist/catalog/detail.asp?page=browse&nprdate=&ic=15&pub=16&op=&keywords=&inst=&occ=&pid=7688&thispage=results.asp
gets changed to

Code:
http://www.churchinstrumentalist.com/catalog/detail.asp?page=browse&nprdate=&ic=15&pub=16&op=&keywords=&inst=&occ=&pid=7688&thispage=results.asp
Now inside the /churchinstrumentalist.com folder i have another htaccess that handels the bulk of the changes and they all work except the one that checks if the URL contains /catalog/detail.asp

here is the htaccess in that folder

Code:
ErrorDocument 404 /?404,136
RewriteEngine On

#Route instrumentalsource.com -> churchinstrumentalist.com
RewriteCond %{HTTP_HOST} instrumentalsource.com$
RewriteRule ^(.+) http://www.churchinstrumentalist.com/$1 [L,R]

#Route theinstrumentalsource.net -> churchinstrumentalist.com
RewriteCond %{HTTP_HOST} theinstrumentalsource.net$
RewriteRule ^(.+) http://www.churchinstrumentalist.com/$1 [L,R]

#Route anylinks to detail.asp to search
RewriteRule ^catalog/detail\.asp.+pid=([a-zA-Z0-9]*).* http://www.churchinstrumentalist.com/?search-results,4&sPhrase=$1 [R]   <--  line that seems to be failing

#Route any links to old subfolders to site root now
RewriteRule publishers(/)?.* http://www.churchinstrumentalist.com/ [R,NC]
RewriteRule order(/)?.* http://www.churchinstrumentalist.com/ [R,NC]
RewriteRule specials(/)?.* http://www.churchinstrumentalist.com/ [R,NC]
Whats happening is its just going to my 404 page, and unlike all the other redirects, the address bar does not change to the proper URL for searching.

Hope this makes scene, and I didn't over complicate things

Thanks
Don
Reply With Quote
  #2 (permalink)  
Old 07-20-09, 04:18 AM
=OTS=G-Man =OTS=G-Man is offline
Newbie Coder
 
Join Date: Jun 2009
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
anyone got any ideas?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HUNDREDS of apache services running ?! slows server down immensley! SlaveDriver Web Servers 0 11-02-08 09:29 AM
apache not working on Mozilla and Opera edzjins PHP 5 09-26-07 04:03 PM
FLV video freezes - apache 2.2.4 JanDW Web Servers 1 05-05-07 11:13 AM
How to connect JSP Tomcat to apache or IIS ardie_b Everything Java 1 03-09-05 06:45 PM
php with Apache in windows eDevil PHP 3 08-08-04 12:03 AM


All times are GMT -5. The time now is 01:29 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.