UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Website Development & Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 18th July 2003, 06:17 PM   #1 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Adding a URL redirect!

I want to add a url redirect which I`m told can be done my editing the .htaccess file? Question is, how do I do it? I`ve found the file in my directory, but there is no edit button. I`ve never done anything with the .htaccess file before, so I`m unsure of what I`m doing.

I want:

http://www.maiandream.co.uk/scripts.htm

to be directed to

http://www.maiandream.co.uk/scripts.php

Thank you for the help.

__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Old 18th July 2003, 06:52 PM   #2 (permalink)
prestige
Registered User
 
Join Date: Jul 2003
Posts: 4
(1) download .htaccess to your computer
(2) open it in the editor of your choice - notepad is a fine choice
(3) insert the following line and change it according to your needs:

Redirect /scripts.htm /scripts.php

(4) save it.
(5) upload it to your account.
prestige is offline   Reply With Quote
Old 18th July 2003, 07:01 PM   #3 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Thanks for the help. I had already tried this. The file downloads as .htaccess[1], if I upload that I then have 2 .htaccess files. If I rename the file .htaccess I`m unable to upload it as I get the following error:

550.htaccess:Permission Denied

Should I delete the original .htaccess file first?
__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Old 18th July 2003, 07:29 PM   #4 (permalink)
prestige
Registered User
 
Join Date: Jul 2003
Posts: 4
What kind of FTP client do you use?
Do you know how to change rights on files (chmod) ?

Make a backup copy of the original file and delete the file from the server afterwards. Afterwards try again to move the .htaccess you created on the server.
prestige is offline   Reply With Quote
Old 18th July 2003, 07:33 PM   #5 (permalink)
UH-Matt
Administrator
 
UH-Matt's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 8,135
You will need to submit a support ticket as it seems you dont have access to your .htaccess file. We can give you access to it once we have the ticket. Thanks.
__________________
.
Matt
UnitedHosting Staff

For official support please use our helpdesk at UnitedSupport.co.uk

UnitedHosting proudly hosting more than 20,000 sites since 1998.
UH-Matt is offline   Reply With Quote
Old 18th July 2003, 07:37 PM   #6 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Ah, thanks Matt. And thanks prestige for your help. I appreciate you pointing me in the right direction.

__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Old 18th July 2003, 08:14 PM   #7 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Well I edited my .htaccess file and added the line:

Redirect /scripts.htm /scripts.php

However, when I access www.maiandream.co.uk/scripts.htm in the browser I now get:

INTERNAL SERVER ERROR

I also tried:

Redirect /scripts.htm /http://www.maiandream.co.uk/scripts.php

But that doesn`t work either.

Any ideas?
__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Old 18th July 2003, 08:28 PM   #8 (permalink)
UH-Simon
Administrator
 
UH-Simon's Avatar
 
Join Date: Oct 2002
Location: Hertfordshire, UK
Posts: 4,601
The 500 error isn't anything to do with the .htaccess redirect. The redirect is working, the problem is with the page you're redirecting to:

http://www.maiandream.co.uk/scripts.php
__________________
.
Simon
UnitedHosting Staff

For official support please use our helpdesk at UnitedSupport.co.uk

UnitedHosting proudly hosting more than 20,000 sites since 1998.
UH-Simon is offline   Reply With Quote
Old 18th July 2003, 08:35 PM   #9 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Well, it wasn`t just the scripts.php page that wasn`t working, it was my whole site.

I have put the .htaccess file back to what it was and everything is working ok again now. So why would editing the .htaccess file cause everything else to disappear?
__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries

Last edited by dreamcatcher : 18th July 2003 at 08:50 PM.
dreamcatcher is offline   Reply With Quote
Old 18th July 2003, 09:36 PM   #10 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Its no problem anyway, I`ve just created a scripts.htm page that directs to the php version.

Thanks.

__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Old 20th July 2003, 09:00 PM   #11 (permalink)
I, Brian
Senior Member
 
Join Date: Apr 2003
Location: Scotland
Posts: 166
Dreamcatcher -

Use your "file manager" option in Ensim to access your .htaccess file - you can even edit it through this option.

This is what you want to use in your .htaccess file to change URLs addressed to a htm file to access a php extension file instead:

Code:
RewriteEngine On
RewriteRule ^(.+)\.htm$ $1.php [L]
I take no credit - had to ask the brains at sitepoint for that - thanks to pippo for the code.
I, Brian is offline   Reply With Quote
Old 22nd July 2003, 07:44 PM   #12 (permalink)
dreamcatcher
Cop No: 663
 
dreamcatcher's Avatar
 
Join Date: Jun 2003
Location: England
Posts: 46
Quote:
Originally posted by I, Brian
Dreamcatcher -

Use your "file manager" option in Ensim to access your .htaccess file - you can even edit it through this option.

This is what you want to use in your .htaccess file to change URLs addressed to a htm file to access a php extension file instead:

Code:
RewriteEngine On
RewriteRule ^(.+)\.htm$ $1.php [L]
I take no credit - had to ask the brains at sitepoint for that - thanks to pippo for the code.
Thanks for that I,Brian!!

__________________
-M-Dream-
::Asian Cinema::Asian Music::Asian Cover Scans::Chinese Astrology::Free PHP Scripts::Hong Kong Photo Galleries
dreamcatcher is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:40 PM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  UnitedForums  |  SEO by vBSEO 3.0.0
Copyright © 1998-2008 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309