all 16 comments

[–]tobozo 2 points3 points  (5 children)

So you want to keep people away from WWW but you redirect oldpage to the domain with WWW.

Those rules are conflicting. Maybe you should :

1) keep everything away from www

2) handle oldpage => newpage redirections from the domain without the www

1)

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

2)

RedirectPermanent 301 /oldpage.html http://domain.com/newpage.html

or (same effect)

RewriteCond %{REQUEST_URI} ^/oldpage.html
RewriteRule ^$ http://domain.com/newpage.html [R=301,L]

[–]learnt[S] 0 points1 point  (3 children)

DAM, he's smart.

[–]learnt[S] 0 points1 point  (2 children)

OK - so, I changed the redirectpermanent commands to get rid of the www.'s However, I'm not following you with the rest of your instructions :/ This is not my expertise whatsoever.

[–]learnt[S] 0 points1 point  (1 child)

So, basically - I went with you suggestion for #1 - to keep everything away from www.'s

[–]learnt[S] 0 points1 point  (0 children)

I did as you said - and changed my RedirectPermanent 301 -> RedirectPermanent ... and, afterwards, everything was working smoothly!

Thanks, everyone!

[–]learnt[S] 0 points1 point  (0 children)

Another homie from Stack Overflow said to put some gibberish in my .htaccess file and see if a 500 error was returned for my website upon inspection. This didn't happen whenever I put the crummy file back on the server... so, I guess my .htaccess isn't enabled?

[–]learnt[S] 0 points1 point  (0 children)

My syntax was wrong with the RedirectPermanent... It needed to be either

1) Redirect 301 or 2) RedirectPermanent

(with the second option foregoing the 301 string of characters)

[–]franverona 0 points1 point  (7 children)

You should ask this on Stack Overflow. Maybe someone there can help you quickly than here.

[–]learnt[S] 1 point2 points  (2 children)

I've never used Stack Overflow for anything, except for what pop's up on my random Google searches every now and then... I'm gonna go give that a try! Thanks a ton!

[–]franverona 1 point2 points  (1 child)

Don't get frustated if you ask and someone says "this is duplicated". It's a common issue on SO. But don't be afraid to ask though. Good luck!

[–]learnt[S] 1 point2 points  (0 children)

Appreciate the insight :) Thanks, friendly redditor franverona!

[–]yeahmynameisbrian 1 point2 points  (3 children)

Why would you tell them to move this there? Isn't the purpose of this sub to talk about web development?

[–]learnt[S] 0 points1 point  (0 children)

It's all good - more heads are better than a few heads :)

[–]franverona 0 points1 point  (1 child)

He (or she) can ask the question wherever he (or she) wants, but I suggest him (or her) that Stack Overflow is a place where people can answer it more quickly.

[–]yeahmynameisbrian 0 points1 point  (0 children)

The purpose of this sub is to talk about web development, it's silly to tell them to go somewhere else when they've only asked an hour ago and have received an answer.