PDA

View Full Version : .htaccess


dipster777
12-02-2010, 09:50 AM
Hi Can anyone please help me i want to impliment a 301 redirect to revert my site to stay as www. but cant find the .htaccess file with dreamweaver cs5 and when i do find it how do i put the code on and upload it again. i can find the .htaccess file on my server with filezilla so i know its there im just not sure how to modify it.

please help

many thanks

davidj
12-02-2010, 10:02 AM
right click it in zilla and select edit

make sure the following is included in the file

RewriteEngine on Then add...


Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
change yoursite.com to your domain

dipster777
12-02-2010, 10:46 AM
I have tried to do this but it the edit option isnt clickable also it wont let me delete or rename file. and on my server it wont let me remove it.
thanks for the quick reply but pretty stuck again.

can you help further

cheers

dipster777
12-02-2010, 10:57 AM
I have tried to do this but it the edit option isnt clickable also it wont let me delete or rename file. and on my server it wont let me remove it.
thanks for the quick reply but pretty stuck again.

can you help further

cheers

also where do i find the code or where do i turn the rewrite engine on

davidj
12-02-2010, 12:18 PM
in zilla you need to tell it what text editor to use

I suggest notepad++ (google it)...

In Zilla..

menu > edit > settings > file editing

browse for a editor (notepad++);

open the .htaccess file and check it has the directive included

RewriteEngine onIf not add it to the top of the file and follow my post above

dipster777
12-02-2010, 12:33 PM
k Thanks for that will give it a do

dipster777
12-02-2010, 12:49 PM
I have tried that and still wont let me edit what should i try next im probably doing something stupid but its really frustrating me
thanks for helping

dipster777
12-02-2010, 12:51 PM
when i try to enter the htaccess file it keeps saying unable to retrieve file and i cant delete it enter it or create a new one

davidj
12-02-2010, 01:00 PM
right click the file in zilla and go to file permissions

the numeric value should be 644. If its not change it to 644 and try to edit it

If you still can't edit it change the numeric value to 777 then edit it, save it and then upload it. Last thing to do is change the file back to 644

dipster777
12-02-2010, 01:26 PM
file permission is set at 755 and it wont let me change any permissions iv tried this on both fillezilla and my server getting very frustrating thanks for helping im totally stumped

dipster777
12-02-2010, 01:35 PM
it wont seem to let me alter anything with it delete it change it or anything i must be doing something wrong but have no idea what.

davidj
12-02-2010, 01:45 PM
can you right click it and view permissions in filezilla?

dipster777
12-02-2010, 01:51 PM
yes can get to file permissions but when i try to change it comes up
550 site chmod command failed
and when i go into my host to change it it just reverts straight back

dipster777
12-02-2010, 02:43 PM
does the ftp have to be set to active and not to passive when im changing this

davidj
12-02-2010, 02:54 PM
You don't have the rights to change the file! You are the administrator of this site yes?

do you have access to the server through SSH?

dipster777
12-02-2010, 03:06 PM
yes I am the administrater

dipster777
12-02-2010, 03:08 PM
whats the ssh i have access through my server or host and access through filezilla do i need to contact my host i can change the permission on all other files exept the .htaccess one.

davidj
12-02-2010, 06:50 PM
if you can SSH onto the server using PuTTY then you should be able to chmod the file to 777

tarekcom2012
12-05-2010, 08:15 PM
Thanhs.....
Good

domedia
12-06-2010, 01:11 PM
do i need to contact my host
Yes, at this point they would be ones to call.