New Posts  All Forums:Forum Nav:

.htaccess help

post #1 of 10
Thread Starter 
I am trying to figure out a way to accomplish this. I was wondering if it's possible, with a .htaccess rule, to separate sites on the same root folder based on the visiting URL.

For example,
say a user goes to www.site1.com, it will redirect it to the folder /site1, but keep the URL as www.site1.com.
Then, if a user types www.site2.com, it will redirect it to the folder /site2, but keep the URL as www.site2.com.

Is this possible?

Thanks!
post #2 of 10
I believe it is with URL rewriting.
post #3 of 10
Thread Starter 
Quote:
Originally Posted by floatingDivs View Post
I believe it is with URL rewriting.
I read up on it but I found nothing to suggest the .htaccess distinguishing two different URLs. Maybe you can offer more information and/or a link? I'll, of course, continue searching. Maybe I am just over analyzing it?

EDIT: Let me correct myself, I was looking at URL redirect, I'll check out URL rewrite right now. Thanks!
post #4 of 10
Quote:
Originally Posted by cubanresourceful View Post
I read up on it but I found nothing to suggest the .htaccess distinguishing two different URLs. Maybe you can offer more information and/or a link? I'll, of course, continue searching. Maybe I am just over analyzing it?
Maybe try using regular expressions in the .htaccess file?

http://www.webweaver.nu/html-tips/web-redirection.shtml
post #5 of 10
Use 301 redirect. Search and you'll find much better explanation than what I could do here.

301 are the way to go. The visitors are not affected (not visible to them). Easy to set up through your cPanel. AND SEARCH ENGINES preffer this way!


Good luck.
The New Girlfried
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD 555 X2 BE --------- unlocked to X4 oc. 3.7 GHz ASRock 870 EXTREME3 ATX PowerColor HD6850 Kingston HyperX Blu 4GB 1600 DDR3 
Hard DriveOptical DriveOSMonitor
SAMSUNG Spinpoint F3 500GB SATA 3.0Gb/s LG DVD±RW SuperMulti Drive Black SATA Windows 7 Samsung 23" 
PowerCase
OCZ ModXStream Pro 700W Thermaltake V6 BlackX Edition 
  hide details  
Reply
The New Girlfried
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD 555 X2 BE --------- unlocked to X4 oc. 3.7 GHz ASRock 870 EXTREME3 ATX PowerColor HD6850 Kingston HyperX Blu 4GB 1600 DDR3 
Hard DriveOptical DriveOSMonitor
SAMSUNG Spinpoint F3 500GB SATA 3.0Gb/s LG DVD±RW SuperMulti Drive Black SATA Windows 7 Samsung 23" 
PowerCase
OCZ ModXStream Pro 700W Thermaltake V6 BlackX Edition 
  hide details  
Reply
post #6 of 10
Thread Starter 
So I got the two domains on one site root thing worked out, now I am having trouble rewriting the URLs on each domain to remove the folder name out of the URL.
post #7 of 10
just 301 it
System X
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 990x Asus Rampage III Extreme EVGA 590 Corsair Dominator GT 
Hard DriveOptical DriveOSMonitor
Intel 510 series 120Gb Asus Windows 7 64 bit Dell 30 
KeyboardPowerCaseMouse
Voodoo Tarantula 900W TopPower HP BlackBird Voodoo Razer 
Mouse Pad
Voodoo 
  hide details  
Reply
System X
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 990x Asus Rampage III Extreme EVGA 590 Corsair Dominator GT 
Hard DriveOptical DriveOSMonitor
Intel 510 series 120Gb Asus Windows 7 64 bit Dell 30 
KeyboardPowerCaseMouse
Voodoo Tarantula 900W TopPower HP BlackBird Voodoo Razer 
Mouse Pad
Voodoo 
  hide details  
Reply
post #8 of 10
It's a bad idea to 301 redirect your homepage if you don't have to. Just use those folders for the domains' roots.
post #9 of 10
Quote:
Originally Posted by OpticWaves View Post
It's a bad idea to 301 redirect your homepage if you don't have to. Just use those folders for the domains' roots.
Actually 301 is the best idea in respect to site effectiveness and SEO!
The New Girlfried
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD 555 X2 BE --------- unlocked to X4 oc. 3.7 GHz ASRock 870 EXTREME3 ATX PowerColor HD6850 Kingston HyperX Blu 4GB 1600 DDR3 
Hard DriveOptical DriveOSMonitor
SAMSUNG Spinpoint F3 500GB SATA 3.0Gb/s LG DVD±RW SuperMulti Drive Black SATA Windows 7 Samsung 23" 
PowerCase
OCZ ModXStream Pro 700W Thermaltake V6 BlackX Edition 
  hide details  
Reply
The New Girlfried
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD 555 X2 BE --------- unlocked to X4 oc. 3.7 GHz ASRock 870 EXTREME3 ATX PowerColor HD6850 Kingston HyperX Blu 4GB 1600 DDR3 
Hard DriveOptical DriveOSMonitor
SAMSUNG Spinpoint F3 500GB SATA 3.0Gb/s LG DVD±RW SuperMulti Drive Black SATA Windows 7 Samsung 23" 
PowerCase
OCZ ModXStream Pro 700W Thermaltake V6 BlackX Edition 
  hide details  
Reply
post #10 of 10
Indeed, forget .htaccess and just set up separate document roots for each site.
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
Underground
(14 items)
 
  
CPUMotherboardGraphicsRAM
Core i7 920 C0 ASUS P6T6 WS Revolution GTX 460 TR3X6G1600C8D 
Hard DriveOptical DriveCoolingOS
WD1001FALS SAMSUNG SH-S223F 22X DVD MULTI Corsair H50 Fedora 16 KDE x86_64 
MonitorKeyboardPowerCase
HP w19b Microsoft Comfort Curve Corsair CX600 Thermaltake Armor VA8003BWS 
MouseMouse Pad
Razer DeathAdder Black 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding