alternate entry point for a website page

Web hosting discussion, programming, and shared and dedicated servers.
6 posts Page 1 of 1
by artmart » Sat Nov 12, 2011 11:21 am
How does one set-up the following entry address - name/website.com
from - website.com/Folder/index.html
Thanks
by thulsa_doom » Sat Nov 12, 2011 7:31 pm
If you currently have a file accessible at http://website.com/Folder/index.html and would like it to be where folks land when they go to http://website.com/ there are a couple of options to pursue:

You can modify your web hosting through the member tool at https://members.sonic.net/websites/hosting/dir/ to point to this new directory. If you have web content that isn't currently in http://website.com/Folder/ this may be a bad option, as that other content wouldn't be available through your domain name any more.

You can redirect requests for http://website.com/index.html to http://website.com/Folder/index.html with a .htaccess file. Some information about using .htaccess is available at https://wiki.sonic.net/wiki/.htaccess#H ... new_URI.3F

You can redirect requests for http://website.com/index.html to http://website.com/Folder/index.html by putting a meta refresh in. We don't have any instructions related to that method, but a web search for "meta refresh" should get you on your way.

Alternately you can simply move the index at http://website.com/Folder/index.html to its parent directory. Download it to your computer with an FTP client and then put it back up in its new home. This may not work smoothly depending on how you referenced other files like images and such within the new index.html file.
John Fitzgerald
Sonic Technical Support
by artmart » Mon Nov 14, 2011 3:54 pm
One of us or both has misunderstood.
The object is to simplify what a person types
from WEBSITE.COM/folder?NAME.html
to NAME/WEBSITE.COM
where the page I want to hit is hitable as
WEBSITE.COM/folder?NAME.html
thxs
by artmart » Mon Nov 14, 2011 3:56 pm
that s/b
from WEBSITE.COM/folder/NAME.html
to NAME/WEBSITE.COM
where the page I want to hit is hitable as
WEBSITE.COM/folder/NAME.html
sorry SMP
by joemuller » Thu Nov 17, 2011 9:37 am
It sounds like you want something like NAME.yourwebsite.com to act the same as yourwebsite.com/NAME. This can be done with a .htaccess file in the main directory for your website. If by some chance you're running Wordpress, you can set up special links to do the same thing - take a look at this page for details:
http://codex.wordpress.org/Using_Permal ... _structure
I'm a proud employee of Sonic.net! :-)
by kgc » Thu Nov 17, 2011 10:19 am
This is a job for apache's mod_rewrite. On our servers, you'll have to have an IP based hosting solution (Basic Hosting) and you'll need to add a wildcard for *.domain.com that is a CNAME to domain.com.

Something like this might work (not tested at all!)

RewriteCond %{HTTP_HOST} !^(www\.)?example.com$ [NC]
RewriteCond %{HTTP_HOST} ^([\.]+)\.example.com$ [NC]
RewriteRule (.*) /%1/$1 [L]

The first line prevents it from matching www, the second, remembers the NAME in your example. The third rewrites the request for name.example.com/foo.html to example.com/name/foo.html
Kelsey Cummings
System Architect, Sonic.net, Inc.
6 posts Page 1 of 1

Who is online

In total there are 17 users online :: 0 registered, 0 hidden and 17 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 17 guests