PDA

View Full Version : Modifying .htaccess File



Kristina
06-09-2007, 11:24 AM
Newbie question here.

I'd like to modify my .htaccess file on a new domain that I just started WordPress on publishing with fantastico. I somehow did this with a previous domain but I keep running into problems with this new one.

What I did was create a text document, put the below in (and change it out to be my domain) and save it as: .htaccess - Then, I copied and pasted it into my FTP manager.

When I did this the whole template in wordpress disappeared.
So then I deleted it and pasted something else in and none of the interior pages worked after that. So I uninstalled WordPress and reinstalled it and am back to square one.

1) Can I create an .htaccess file with a text document? It doesn't seem to work.... I was thinking maybe I had the wrong stuff in the example below (which is what I used) or maybe I needed to modify the file date? Maybe there is so much in there?

2) If I can't use the txt file to create and paste in, how can I edit this file? :-) I'm a fairly quick study but I feel lost!

3) On my other domains, it only rewrites the root page. Any of the interior pages (http://mydomain.com/pagehere.html) 301 redirect to the homepage. I suppose that is ok but I would really prefer it to redirect to the sister page with the www on it instead. So any advice here would be awesome.

Thanks for any help someone can point me to!! Here is what I created in the txt file and pasted into my FTP manager.

# File modified on Fri Aug 18 22:55:52 2006 by server
# ReWrite is not a supported htaccess directive
# ReWrite Engine On
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^(.*)$ http://www.mydomain.com [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Pethens
06-09-2007, 12:02 PM
Try this:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

There is nothing wrong with your text editor. It's just a matter of getting the rewrite rules right.

Kristina
06-09-2007, 07:46 PM
Pethens - THANK you for the modifications!

Ok, I put that directly into my txt file, saved it as .htaccess, copied and pasted it into my FTP.

All the URLs work perfectly (as well as the interior ones being 301'd to the proper page) but the WordPress template I had on lost all the data and is just a jumble of text now.

The URL is (removed in case not allowed - see next post) - You can see what I'm talking about?

I don't know what to do at this point? It's the .htaccess file that made this change take affect. Is there something wrong in it?

Last time this happened, as I said above, I just removed WordPress and started over again....

I just don't know what is going wrong with the htaccess that would make WordPress lose the template.

Then again, I'm a completely newbie at this so it may be something simple...

Any advice is appreciated! I'm leaving it as is for right now if anyone wants to take a peek at what is going on.

Thank you!

Kristina
06-09-2007, 10:03 PM
SUCCESS!!

I noticed in my backend of WordPress that my template had the sample image missing. The other templates (and the backend) however were good to go.

I just recopied the template I wanted back into my FTP manager and all is well again. PLUS the fantastic htaccess rewrite codes work perfectly.

Thanks so much for your help with the new htacess codes and support. :) I really appreciate it. I removed my url in my post above in case urls are not allowed here.

Kristina
06-10-2007, 01:58 PM
Gah! So I went in today to write a post and my WYSIWYG editor was broken. I waited around and fiddled with a few things and that didn't fix it. Asked for advice on the Wordpress forums. Then, I tested it out in Firefox and the editor DID work.

Which was frustrating. I prefer using IE (i know, I know).

Ok, my point here is that I removed Wordpress again, reinstalled it again... and the editor was STILL broken! (Although broken in a different way.)

I just called Bluehost and they are wiping the slate clean for me and I'm going to install again.

Before I install wordpress, or get to far, is there any advice to give me about getting my .htaccess file working correctly without harming anything?

Is using the txt file the way to go? Why does everything turn crappy once I use that and paste it in? What is the best way to edit it and get it in my site?

:) Thank you!

Pethens
06-10-2007, 03:28 PM
The problems you are describing don't really sound like they are caused by your .htaccess file, but if you want to test that, simply deleting the .htaccess file will tell you. No need to wipe wordpress clean and start over again!

Kristina
06-10-2007, 09:29 PM
Pethens, I'm dangerous :) Apparently.
I really shouldn't be allowed to do this.

So, I started over and my editor is apparently not working in IE6 but works in Firefox.

I am looking over all the posts in WordPress Support and no one seems to have my problem. :) Others have had Rich Text Editor errors but they have been able to fix them.

I also wrote a post in one of my earlier downloads in WordPress so it worked on Friday. I don't think BlueHost updated their WordPress 2.2 download over the weekend (although I suppose they could have) and did something to the WYSIWYG (Rich Text Editor).

If I turn it off in my User Profile, I can type. But I would really prefer to use the WYSIWYG editor!

Any thoughts on how to fix it? My IE toolbar on the bottom left says 'Done, with errors' and I can't put my mouse cursor into the Rich Text Editor box. The box is just not 'open'.

Help?

Kristina
06-10-2007, 09:35 PM
I was able to click on the bottom left error thingie and here is what the popup details dialouge box said:

Line: 176
Char: 290
Error: Access is Denied
Code: 0
URL: http:// mybigbearvacation .com/wp-admin/post-new.php

Thanks!

Pethens
06-11-2007, 09:44 AM
It sounds like a cross-site scripting error. Try reporting this at the wordpress forum.

Kristina
06-11-2007, 12:28 PM
Thanks Pethens!