LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2009, 09:47 AM   #1
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Rep: Reputation: 0
Apache Redirect Help!


Hey, I know this question might be outside the usual realm for this forum, but I thought I might have luck in a place full of programmers than I did at the Joomla forums.

I have recently merged two Joomla 1.0 sites I ran into one. I imported the articles I wanted to keep to the new site, and I have the old site's domain pointing as an alias at the new site. The new site is www.theouthousers.com . The old site was www.bludblood.com .

I also have the core SEF URLs on, suing the htaccess.txt file that came with Joomla.

I have one writer for the old site who linked to his articles in various places, so I am trying to set up redirects for him so that he doesn't have to change all of his links.

For instance, I need something like:

http://www.bludblood.com/joomla/inde...d=25&Itemid=51

To redirect to the equivalent location on the new site:

http://www.theouthousers.com/content...tegory/84/163/


And I also need specific links like:

http://www.bludblood.com/content/view/700/51/

To redirect to their new counterparts:

http://www.theouthousers.com/content/view/3031/163/

Keeping in mind that www.bludblood.com is now an alias of www.theouthousers.com, is there any way to do this? I have been trying with rewrite rules and redirects, and cannot seem to achieve the desired effect.

Tried various versions of:

Code:
Redirect http://www.bludblood.com/joomla/index.php?option=com_content&task=blogcategory&id=25&Itemid=51  http://www.theouthousers.com/content/blogcategory/84/163/
With the http, without, as regexps, as 301s, as permanents, etc, and it just will not work. Also tried as RewriteRule.

Anyone familiar with this?
 
Old 04-07-2009, 09:49 AM   #2
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteRule ^(content/|component/) index.php

This is the other rewrite stuff in .htaccess for Joomla's core SEF component.
 
Old 04-07-2009, 11:47 AM   #3
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Frustratingly, I'm able to MOSTLY get this to work, but though it isn't causing a problem, it is appending everything after index.php onto the end of the URL. I used this code to get the redirect to work:

Code:
RewriteCond %{REQUEST_URI}  ^/joomla/index\.php$
RewriteCond %{QUERY_STRING} ^option=com_content&task=blogcategory&id=25&Itemid=51$
RewriteRule ^(.*)$ http://www.theouthousers.com/content/blogcategory/84/163 [R=301,L]
It results in a URL called http://www.theouthousers.com/content...d=25&Itemid=51, which works, but would be best if I could get it to just http://www.theouthousers.com/content...ategory/84/163. Anyone have any ideas?
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2 Redirect kmeyers Linux - Software 4 02-26-2009 07:13 AM
apache redirect mahmoud Linux - Newbie 3 01-13-2009 08:59 PM
redirect in Apache baslemmens Linux - Networking 6 09-02-2004 12:07 PM
How to redirect apache to tomcat? gepesz Linux - General 0 07-29-2004 09:16 PM
apache redirect? fibbi Linux - Software 7 01-30-2004 10:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration