Dear newbusinessowner,
The commenters below suggest several variants of the Redirect
directive. For my part, I recommend the more powerful Rewrite directive.
The first step to take once you're logged in as administrator is
to navigate to the website's root directory, where the home page is
located. Now open the file .htaccess if it exists, or make a new one if
it doesn't, and add to it the following lines.
RewriteEngine on
RewriteBase /
RewriteRule custom CUSTOMPLANS/customhome.php
Once you've saved the .htaccess file, any user's request for the
www.mywebsite.com/custom page will be rewritten as a request for
www.mywebsite.com/CUSTOMPLANS/customhome.php . The user won't know
where the customhome.php file is located or even that they're viewing
a .php file, since their browser will continue to show the location as
www.mywebsite.com/custom . This is a great convenience because you can
always change the implementation or location of the custom page without
asking users to change their bookmarks. You need merely adjust your
.htaccess file accordingly.
If you do want to perform an external redirect, which means that
the user's browser is told to automatically make a request for
CUSTOMPLANS/customhome.php instead of custom, just add the [R] flag to
the last line, so that it reads as follows.
RewriteRule custom CUSTOMPLANS/customhome.php [R]
In this case, the user's browser will actually change from
www.mywebsite.com/custom to www.mywebsite.com/CUSTOMPLANS/customhome.php .
Regards,
leapinglizard |
Request for Answer Clarification by
newbusinessowner-ga
on
08 Apr 2005 18:49 PDT
I apologize, but I don't know how to create a .htaccess file. How do you do that?
|
Clarification of Answer by
leapinglizard-ga
on
08 Apr 2005 18:57 PDT
You can use any text editor to make a .htaccess file. If you have
terminal access to the webhost, the pico editor is probably at your
disposal. Just type
pico .htaccess
to get started and use the commands displayed at the bottom of the
screen. Once you're done entering the text, type Ctrl-X to exit and
press Enter when it asks whether you want to save changes, then Enter
again to confirm the file name.
Another possibility is to use the cat command to enter everything in
one shot. Execute
cat > .htaccess
and then type or paste in the three lines above, press Enter, and
finally type Ctrl-D to end the file. Voila, you have a new .htaccess
file.
Finally, if you don't have terminal access, make the .htaccess file on
your local machine using a simple text editor such as Notepad, and
upload it to your webhost with whatever tools you normally use for
file transfer.
leapinglizard
|
Request for Answer Clarification by
newbusinessowner-ga
on
09 Apr 2005 05:29 PDT
no clarification, just a simple thanks.
we discovered how to update the htaccess we had to call our hosting
company, we had to dust off some of our website to get it done. never
touched that file, so thanks.
this is the best tool!
I appreciate your help.
|
Clarification of Answer by
leapinglizard-ga
on
09 Apr 2005 06:33 PDT
Thank you for the kind words and the handsome tip.
leapinglizard
|
Request for Answer Clarification by
newbusinessowner-ga
on
18 Apr 2005 04:43 PDT
Not sure if this works after you submit a rating and pay, but here goes.
This worked and was quite helpful, but I had some problems with images
that were traced back to the .htacess file.
I had some image problems after this was done that was not noticed right away.
The redirect lines caused a 500 error on the server. Many suggestions
were made to fix this problem, and I'm sure it would have about
putting images in different folders, but I decided on a simpler
redirect routine that was found on the following page:
http://www.sa.sdsu.edu/communications/styleguide/redirect-instructions.html
just in case others see this thread. I do believe this helped alot
though and I stick to my rating. Good job, Google experts!
|