I am trying to create a site that...

3 replies
  • WEB DESIGN
  • |
I want readers to be able to type in just the http://www.oobaloo(dot)net/cars
and be taken to a webpage that will contain instructions.

I don't want readers to need to type in the entire URL like

http://www.oobaloo(dot)net/cars/This...geYouWant.html

The website is set up as an add-on domain. I believe I need to create a sub-domain within the add-on domain, but how do I make that take them to a particular webpage without them needing to type in the entire URL.

I have seen this done before in several book that direct the readers to something like www.simplesite(dot)com/ShortWord without the additional / after the com.

Using search here at the WF I found this: http://www.warriorforum.com/website-...ml#post7279169

But that takes people to another website.

Any ideas?

Thanks,

:-Don
#create #site
  • Profile picture of the author Brandon Tanner
    Don,

    You would simply need to add a single line to your .htaccess file to do that. Look in your root directory for the .htaccess file (if you don't have one, then you'll need to create one -- it's just a plain text file named ".htaccess"). Then just add this line to it...

    Redirect 301 http://www.oobaloo(dot)net/cars http://www.oobaloo(dot)net/cars/ThisIsThePageYouWant.html

    Be careful with .htaccess files though... one tiny little syntax error can take your whole website down! (so you might want to make a backup copy of any existing .htacess files before you edit them).
    Signature

    {{ DiscussionBoard.errors[8286403].message }}
  • Profile picture of the author Don Schenk
    Thanks Brandon,

    There was not an .htaccess file. So I created one. I still have some goofyness. Here is what I did...

    I created a subfolder called /happy/ inside oobaloo(dot)net. I then uploaded a test file I called hounddog.html

    If I go to http://www.oobaloo(dot)net/happy/hounddog.html the hounddog.html opens fine.

    Next I created an .htaccess file with:

    Redirect 301 http://www.oobaloo(dot)net/happy http://www.oobaloo(dot)net/happy/hounddog.html

    First I put it into the /happy/ directory and went to http://www.oobaloo(dot)net/happy I got a 404.

    So I moved the .htaccess into the oolaboo(dot)net folder. Likewise a 404.

    Next I moved the .htaccess file to the public_html folder. Again 404

    I even tried moving the .htaccess file out before the public_html folder. 404!

    Maybe it would be simpler to give the hounddog.html (or whatever I'll call it) a really short name like "Z.html" and just stick it in the /happy/ sub which I could call "/A/"

    What am I missing?

    Hmmm, I just noticed a space in the middle of the .htaccess file. Let me remove that, and try again.

    Nope. That didn't do it either. And depending upon where I put the .htaccess some times I get and internal server error. I also did it again with a / where the space was in .htaccess.

    Thanks again.

    :-Don
    {{ DiscussionBoard.errors[8287898].message }}
    • Profile picture of the author Brandon Tanner
      Originally Posted by Don Schenk View Post

      What am I missing?
      1) Did you create the .htaccess file correctly? The entire name of the file is .htaccess (don't forget the dot at the start of the name). Check the name of the file on your server via FTP and make sure it's not named .htaccess.txt (which is a common mistake people make when trying to create a .htaccess file from a plain text file).

      2) Are you using an Apache / Linux server? (those are the most common types of servers, but some hosts use Windows servers, which I believe don't support .htaccess).

      3) Have you tried using relative URL's instead of absolute ones? Like...

      Redirect 301 /happy /happy/hounddog.html

      ^ Normally that wouldn't make any difference, but it might, depending on how your server is configured.

      Other than that, it might just be some weird server configuration that's preventing .htaccess from working (some hosts may have it disabled by default, or set up wrong). Might want to contact your webhost and see if they can shed some light on the issue.

      I don't know of any other way to do what you want without using .htaccess. You can create simple redirects from one page to another page via PHP (ie YourSite.com/pageA.php --> YourSite.com/pageB.php). But you can't redirect from a "folder" to a page via PHP (ie YourSite.com/folderA --> YourSite.com/somepage.php).
      Signature

      {{ DiscussionBoard.errors[8291555].message }}

Trending Topics