Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1021 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Other Programming Languages :

mod rewrite question

Thread title: mod rewrite question
Closed Thread    
    Thread tools Search this thread Display Modes  
04-02-2007, 02:26 PM
#1
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old  mod rewrite question

Is there a way with mod rewrite to send www.domain1.com/uploads/file.ext to www.domain2.com/uploads/file.ext? I am probably going to sell img911.com's domain to someone, but I want a way to keep the current files uploaded for a while.

04-02-2007, 03:52 PM
#2
iisbum is offline iisbum
iisbum's Avatar
Status: Member
Join date: Oct 2005
Location: Clifton Park, NY, USA
Expertise:
Software:
 
Posts: 273
iTrader: 4 / 100%
 

iisbum is on a distinguished road

  Old

Yes.

This is how I do my domain redirect to add the www, for people use domain.com, you can easily update to do what you need.

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

04-02-2007, 06:14 PM
#3
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

I dont know mod rewrite, so no I cant

04-02-2007, 06:20 PM
#4
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.|)img911\.com$
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
In theory, that should redirect and requests to img911.com (or www.img911.com) to www.newdomain.com. I just copied Mubs' code and edited it a bit, without putting my Rewrite hat on so it might not work.

04-02-2007, 06:27 PM
#5
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

is there a way to do mod rewrite on a shared host?

04-02-2007, 06:29 PM
#6
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Yep, most hosts allow you to create a plain text file called ".htaccess" (note the "." before the name) into which you put the rewrite code. Plonk that file into the web-root folder of img911.com.

04-02-2007, 09:34 PM
#7
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Im on a windows server, that would mean I put it in httpdocs?

04-02-2007, 10:42 PM
#8
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

ah **** windows (specifically IIS), mod rewrite doesnt work on it. I'm moving back to linux!

04-04-2007, 02:57 PM
#9
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

the code would be put in the uploads folder of whoever gets img911

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^img911\.com
RewriteRule (.*) http://www.8boards.com/uploads/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.img911\.com
RewriteRule (.*) http://www.8boards.com/uploads/$1 [R=301,L]
this will redirect images hotlinked on forums and such

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed