Problems when i tried to 301 redirect index.php to root and remove www

Started by Clickout, December 13, 2010, 04:25:19 AM

Previous topic - Next topic

Clickout

hi,

I tried to 301 redirect the /index.php to root folder , also i tried to remove the www prefix from my domain using .htaccess file.


I've used these codes in my .htaccess file:
Options +FollowSymlinks
RewriteEngine on

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

RewriteBase /
RewriteRule ^index\.php$ / [R=301,NC]




But when i used these codes, the quoting and quick edit stopped working. :(


  • I'm using pretty url's too.
  • My site exclusively uses smf software.
pl. help me.


Clickout

Quote from: Illori on December 13, 2010, 06:06:14 AM
Quote from: Illori on December 06, 2010, 08:03:49 AM
is http://www.simplemachines.org/community/index.php?topic=386816 any help?
similar topic but not working. :(


I think it is not possible to achieve without errors, sometimes there is a conflict between the pretty url's. when one problem is solved other comes up like sometimes the mod_rewrite doesn't work with sub domains and parked domains. i hope someone'll advice an error free code.

Kindred

there might be a conflict with pretty urls, since that one also creates redirects, etc. because my htaccess to redirect worked just fine (and I have never used pretty urls)

I'd say get rid of "pretty urls" if you want to not use www... (although why you'd want to do that, I don't know....   I got so much hassle for having a domain without the www)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Clickout

i decided to avoid www prefix and /index.php on seo conciderations.

Kindred

how are there *ANY* "seo" considerations that are at all affected by www or index.php?

(hint: there are none)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JBlaze

Quote from: Kindred on December 13, 2010, 11:43:22 PM
how are there *ANY* "seo" considerations that are at all affected by www or index.php?

(hint: there are none)
Having your site accessible by both www. and non-www. is considered duplicate content on search engines, and your site will be penalized ;)
Jason Clemons
Former Team Member 2009 - 2012

Kindred

yes.... but "avoiding www" is not really a valid concern.


And BTW: That statement is not relevant to 2.0, since 2.0 handled canonicalization correctly (although, I think 2.0 handles it by USING the www)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Clickout

Quote from: JBlaze on December 13, 2010, 11:47:57 PM
Quote from: Kindred on December 13, 2010, 11:43:22 PM
how are there *ANY* "seo" considerations that are at all affected by www or index.php?

(hint: there are none)
Having your site accessible by both www. and non-www. is considered duplicate content on search engines, and your site will be penalized ;)

you're right  ;D the www prefix can be handled in the google webmaster tools, but the index.php is a real issue in seo.

Kindred

no it is not....     That complaint is 5 year old...   Google (and the others) now correctly catalog sites with index.php?argument=XYZ

especially since SMF uses the canonicalization correctly.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

akc42

I wonder if your problem isn't the same as mine?  Namely you need to set $boardurl in Settings.php to the same value as the rewrite eventually gives (ie in your case without the www).

see
http://www.simplemachines.org/community/index.php?topic=413007.msg2880999#msg2880999

Advertisement: