Jump to content

Urgent HTACCESS help :)

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Urgent HTACCESS help :) Rate Topic: -----

#1 User is offline   Isi 

  • W.R. Private
  • Group: Members
  • Posts: 17
  • Joined: 01-August 06

Post icon  Posted 09 August 2006 - 08:45 AM

Hey

Seen as my hosting totally sucks, I have used an addon domain as a parked domain (as I ran out of addon slots). So the addon domain is http://www.gettsforever/ and I want it to redirect to http://www.gettsforever/age/

Now I know that you can in htaccess, because after a day of prowling webmasterworld i found the code a few months ago and was using it happily on another domain, but for the life of me I cant find it anymore. So the HTaccess is the best route and I was wondering if any of you knew?

I also was made aware of a php way to do it, but I dont really want to go on that route as I want this to be a permanent. And I can use the index.php for the main content of my host site :)

Any help would be really appreciated. Thanks in advance!
0

#2 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 09 August 2006 - 09:00 AM

I should be simple really, assuming your server supports mod_rewrite:

Simply insert this into .htaccess:

Redirect / /age/

The red slash just says "all incoming visitors to the root of the site"
...and the green directory /age/ becomes where mod_rewrite sends them.

The above was sampled from Sample #8 on this web page.
0

#3 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 09 August 2006 - 10:02 AM

If that doesn't work (although it certainly should!) you can also try:
RedirectMatch Permanent ^/$ http://www.gettsforever/age/

QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#4 User is offline   Isi 

  • W.R. Private
  • Group: Members
  • Posts: 17
  • Joined: 01-August 06

Posted 09 August 2006 - 02:35 PM

No no, I have a lot of domains parked which I will redirect to different folders so I need a way to tell a specific domain to redirect to the specific folder for that domain.
0

#5 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 09 August 2006 - 02:55 PM

To assist with my overwhelming confusion, I'm going to attempt to clarify what I think you are looking for, you please let me/us know if I'm right:

You own
  • www.domain1.com
  • www.domain2.com
  • www.domain3.com
  • (and on and on)
and you're looking for code that will tell a visitor's browser to do the following things:
  • When a browser requests "www.domain1.com", for instance, go to this url: www.yourhosteddomain.com/domain1/
and
  • When a browser requests "www.domain3.com", for instance, go to this url: www.yourhosteddomain.com/domain3/
The highlighted red domain name is the same domain name; one that you've got hosted, and it contains directories housing the web site files meant for your other domain names (domain1.com, domain2, etc.)

Do I understand correctly now?
0

#6 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 10 August 2006 - 02:01 AM

If this is what you're after, I don't believe that htaccess can do this, as it would need access to the name of the site the user is trying to reach. I don't think htaccess can work with variables unless they're part of the URL?

The best solution I can think of would be to use a language such as ASP or PHP to check the site that the user is trying to visit and redirect them accordingly.

Of course even better than that would be to get more addon slots somehow. It might also be worth checking that you're not breaking your host's T&C's by doing this.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#7 User is offline   Isi 

  • W.R. Private
  • Group: Members
  • Posts: 17
  • Joined: 01-August 06

Posted 10 August 2006 - 05:39 AM

Herk is right! That's how I should have explained it:P

Also Im sure it can be done, as i have been able to do it before.

Off the top of my head, I can remember it something like:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^gettsforever\.org
RewriteRule (.*) /age/$1 [L]


the above doesn't work, gives me error 500 and a few others...
0

#8 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 10 August 2006 - 07:33 AM

Well, I'm glad I guessed it right, but that's about as far as my brain goes :ninja:, I really don't know enough about these things to think of a solution, but I'm sure someone will.

Best of luck!
0

#9 User is offline   Isi 

  • W.R. Private
  • Group: Members
  • Posts: 17
  • Joined: 01-August 06

Posted 10 August 2006 - 12:20 PM

Hi thanks Herks, I hope someone can help!
0

#10 User is offline   magazineforall 

  • W.R. Private
  • Group: Members
  • Posts: 43
  • Joined: 01-August 06
  • Location:York, England, UK

Posted 16 August 2006 - 06:34 AM

http://www.theadminzone.com/forums/article...e&aid=18955



I think that's what you're looking for a "301 redirect."


Remember to place the .htaccess file in the directory your domain is linking to (e.g. the root folder). I can't see any other problems you would have. :)



Hope that helps and the info you need is further down the page.


"How to setup a proper 301 redirect"



Good luck and hope you get it sorted. :D

P.S. You will need to create a new .htaccess file for each of your domain names. Unless there is a way of combining it all into one...

I also found this article too. Again information you need is further down the page:

http://www.appliedseo.com/archives/seo-tec...ome-page-please

This post has been edited by magazineforall: 16 August 2006 - 06:49 AM

0

#11 User is offline   EncoderDecoder 

  • W.R. Sergeant
  • Group: Members
  • Posts: 260
  • Joined: 01-March 11
  • Gender:Female
  • Location:Philippines

Posted 12 July 2011 - 10:12 AM

is this solved already..?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users