|
|
|
|
Thread title: mod rewrite question |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
04-02-2007, 02:26 PM
|
#1
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
mod rewrite question
|
|
04-02-2007, 03:52 PM
|
#2
|
Status: Member
Join date: Oct 2005
Location: Clifton Park, NY, USA
Expertise:
Software:
Posts: 273
|
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
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
I dont know mod rewrite, so no I cant
|
|
04-02-2007, 06:20 PM
|
#4
|
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
Posts: 3,820
|
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
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
is there a way to do mod rewrite on a shared host?
|
|
04-02-2007, 06:29 PM
|
#6
|
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
Posts: 3,820
|
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
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
Im on a windows server, that would mean I put it in httpdocs?
|
|
04-02-2007, 10:42 PM
|
#8
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
ah **** windows (specifically IIS), mod rewrite doesnt work on it. I'm moving back to linux!
|
|
04-04-2007, 02:57 PM
|
#9
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
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
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|