iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2008, 08:06 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default 500 server error from htaccess

Quick guys i need some help! Ive just added this .htaccess file to a site and now im getting a 500 internal server error.

Is there anything wrong with this???

Code:
RewriteEngine on
RewriteRule ^/index\.php$ http://www.domain.co.uk/ [R=301, L]
RewriteRule ^(.*)/index\.php$ http://www.domain.uk/$1/ [R=301, L]
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #2 (permalink)  
Old 05-07-2008, 08:07 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: 500 server error from htaccess

By the way - its a linux server with apache.
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #3 (permalink)  
Old 05-07-2008, 08:51 AM
minstrel's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 2,554
minstrel RepRank 2minstrel RepRank 2
Default Re: 500 server error from htaccess

Try adding

Code:
Options +FollowSymLinks
before

Code:
RewriteEngine on
Then remove one of the ReWrite lines, probably the first one.

And you should only have one line terminating in ",L]
Reply With Quote
  #4 (permalink)  
Old 05-07-2008, 09:46 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: 500 server error from htaccess

Cheers for the help minstrel. htaccess is not one of my strong points!

Would this code work the same?

Code:
redirect 301 /index.php  http://www.domain.co.uk
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #5 (permalink)  
Old 05-07-2008, 09:56 AM
minstrel's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: Ottawa, Canada
Posts: 2,554
minstrel RepRank 2minstrel RepRank 2
Default Re: 500 server error from htaccess

Yes. That should work.
Reply With Quote
  #6 (permalink)  
Old 05-07-2008, 10:22 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: 500 server error from htaccess

Can i just clear up something that I'm unclear of....?

All suggestions for getting rid of canonicalization advice given out on this forum suggests using mod rewrite to get rid of /index.php.

If the standard htaccess 301 code works as well then why is mod rewrite the suggested method?
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #7 (permalink)  
Old 05-07-2008, 10:56 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 500 server error from htaccess

I think it is the suggested method because it is often already being used to deal with www.domain.tld vs domain.tld issues, so adding two more rules is often easier to explain.

You can do both of your redirects with a more traditional approach, which I would recommend over mod_rewrite if you are not already using mod_rewrite for another purpose.

Redirect 301 /index.php http://www.domain.com/
RedirectMatch 301 /(.*)/index.php http://www.domain.com/$1/

This method avoids the extra overhead of enabling the rewrite engine. However, if you already use mod_rewrite to perform internal redirects (converting URLs to query strings in a way invisible to visitors and bots) you won't save any overhead since the engine is already activated. In that case you would just use whichever method you are more comfortable with.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #8 (permalink)  
Old 05-07-2008, 01:20 PM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: 500 server error from htaccess

This code didnt work at all! Got me in trouble with the boss as well!

Code:
 redirect 301 /index.php http://www.domain.co.uk
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #9 (permalink)  
Old 05-07-2008, 02:48 PM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 500 server error from htaccess

What happens when someone tries to access the /index.php page with that redirect code in use? Still the error 500?
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #10 (permalink)  
Old 05-08-2008, 06:57 AM
inertia's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Apr 2006
Location: Lancaster, UK
Posts: 1,021
inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6inertia RepRank 6
Default Re: 500 server error from htaccess

It comes up with an error screen saying there a redirect error when you try the root URL. It works if you try it with the /index.php?
__________________
Latest Blog Post: Google Consultant - Should this Job Title be Allowed? - Matt Inertia's SEO Blog - SEOers.org

"Carpe diem, seize the day boys, make your lives extraordinary"
- Dead Poets Society
Reply With Quote
  #11 (permalink)  
Old 05-08-2008, 10:35 AM
wige's Avatar
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,648
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 500 server error from htaccess

If you remove the redirect rule, does the root URL automatically redirect to the /index.php version? It is possible there is an opposite rule elsewhere that breaks the redirection that you are trying to do.
__________________
The best way to learn anything, is to question everything.
Reply With Quote
  #12 (permalink)  
Old 05-09-2008, 04:22 AM
WebProWorld Pro
 
Join Date: Sep 2003
Location: Internet
Posts: 213
Manpasand RepRank 0
Default Re: 500 server error from htaccess

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

Use to deal with www.domain.com vs domain.com canonicalization issues.
Reply With Quote
  #13 (permalink)  
Old 05-09-2008, 04:40 AM
WebProWorld Pro
 
Join Date: Sep 2003
Location: Internet
Posts: 213
Manpasand RepRank 0
Default Re: 500 server error from htaccess

Here is another sticky thread on canonicalization issue.
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
500 internal server error stops googlebot crawling my site? internet-marketing-cr Search Engine Optimization Forum 10 01-18-2007 02:57 PM
Runtime Error - Line 1 - Error Syntex Error charms987 Graphics & Design Discussion Forum 6 07-29-2005 12:56 PM
Server Error 500 on PHP/MySQL site MarcieZoob Web Programming Discussion Forum 6 07-17-2005 07:02 AM
Setting up customized error page with .htaccess protection StephenGarcia Web Programming Discussion Forum 1 12-20-2004 07:07 PM
Dynamic site: Tackling 500 Http Server error lucks Graphics & Design Discussion Forum 2 05-13-2004 11:03 PM


All times are GMT -4. The time now is 07:41 PM.



Search Engine Optimization by vBSEO 3.3.0