LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2008, 12:33 AM   #1
jamsda
LQ Newbie
 
Registered: Apr 2006
Distribution: mostly Slack
Posts: 9

Rep: Reputation: 0
mod rewrite question


Hello,

Need some help rewriting from one subdomain to another that takes in account potentially old bookmarks from the old subdomain. I have a basic redirect like:

RewriteCond %{HTTP_HOST} ^oldsub.domain\.com$ [NC]
RewriteRule ^/(.*)$ http://newsub.domain\.com/$1 [R=301,L]

Which works fine. But on the RewriteCond I'm trying to figure out a wildcard for users that may have bookmarked eg (oldsub.domain.com/forum/something.php?do=thread). So everything to the right of oldsub.domain.com/ erased, and redirected to the newsub.domain.com

Any ideas? Would be much appreciated..

Thanks,
Jim
 
Old 10-18-2008, 06:31 PM   #2
zmanea
Member
 
Registered: Sep 2003
Location: Colorado
Posts: 85

Rep: Reputation: 15
It looks like what you currently have would send the request http://oldsub.domain.com/example to http://newsub.domain.com/example, but you really want it to wipe anything after the domain name. Take out the $1, example below.


RewriteCond %{HTTP_HOST} ^oldsub.domain\.com$ [NC]
RewriteRule ^/(.*)$ http://newsub.domain\.com [R=301,L]
 
  


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
Mod Rewrite Problem mpapet Linux - Server 0 03-30-2008 04:51 PM
Mod Rewrite - Apache FormalLogic Linux - Server 2 03-19-2008 01:30 AM
Apache2 mod vhost_alias - problems with .htaccess mod rewrite d_t_baker Linux - Server 1 08-16-2007 07:32 PM
Mod Rewrite Help carminejg3 Linux - Software 0 12-20-2004 05:19 PM
apache mod rewrite Robert0380 Linux - Software 5 07-31-2003 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:47 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