PDA

View Full Version : Pls Help, my www is not working.


athlon24
11-20-2008, 12:02 PM
sarahG gave me a tagged that www.thatwashot.com is not working... it's redirecting to google. I don't know what to do now. can anyone help?

Kevin
11-20-2008, 12:30 PM
can you post your .htaccess file here so that I can have a look at it :)

kocharvimal
11-20-2008, 12:56 PM
strange problem..have never heard of any such issue...

athlon24
11-20-2008, 02:50 PM
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^thatwashot\.com
RewriteRule (.*) http://thatwashot/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

this is my .htaccess. confused now.

navjotjsingh
11-20-2008, 03:20 PM
Seems you have messed up WOrdpress permalinks code with the www redirection code.

Firstly Replace above contents with this:

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

# END WordPress

And now after this code put this:

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

Now check. This is the code I am using...so it should work for you too.

athlon24
11-20-2008, 04:09 PM
thanks man. that really works. you saved my day. I'll put your rss on my WOAS plugin for a month as a gratitude. :D

sarahG
11-20-2008, 04:22 PM
Seems you have messed up WOrdpress permalinks code with the www redirection code.

The code Athlon posted wouldn't make a difference in the placing. The problem is this line

RewriteRule (.*) http://thatwashot/$1 [R=301,L]

there's no .com in the URL.

However, that said, I wouldn't have the redirection in between the WordPress comments just for ease of understanding. I personally use

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^thatwashot\.com$ [NC]
RewriteRule ^(.*)$ http://thatwashot.com/$1 [R=301,L]

# BEGIN WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress


This way the Rewrite engine is set to on at the top. Then it first checks the domain before doing the permalink rewriting. Which is a better option as it's less server resources if you're going to redirect. Then it does the permalink.

Also saying 'if the http host is not (!) this domain, redirect to the specified domain', this way if any other forms of the domain or any other (future) parked domains are used, you only ever need this one line.

athlon24
11-20-2008, 05:21 PM
@sarahG
so sarahG, can I just paste the last code you have posted and it's ok already?

sarahG
11-20-2008, 07:09 PM
@sarahG
so sarahG, can I just paste the last code you have posted and it's ok already?

Yes it should be fine as that's how I have it on my own site (with my own domain of course).

athlon24
11-21-2008, 02:22 AM
ok, I will do that then... thanks.

--------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, cpanel@hosting24.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
-------------
sarahG, got this. :(

navjotjsingh
11-21-2008, 02:42 AM
Seems to work athlon here. Where's the problem?

athlon24
11-21-2008, 02:56 AM
it's working now, i just figured it out that you can't use enter in .htaccess.
The thing is when i pasted the code that sarahG gave, it's one straight line, so i edit it and arranged it with new line each and that time it did not work. but i returned it back to one straight line and it's working now.

sarahG
11-21-2008, 08:34 AM
You shouldn't have to have it in one straight line. Well, it makes it much harder to read.

Sounds like something else but if it's working there's no point in fixing it :)

athlon24
11-21-2008, 02:25 PM
i tried to have it one line, because when I copied it from here and pasted it. It is one line. then thatwashot.com works but when i go to single post, it goes to my webhosting. So I just used the first option given to me here and it works for me. thanks though for both of you.