|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| 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
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
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 |
|
||||
|
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 |
|
||||
|
Try adding
Code:
Options +FollowSymLinks Code:
RewriteEngine on And you should only have one line terminating in ",L]
__________________
Psychology Mental Health & Self-Help Forum Online Counseling & Therapy | Mental Health Directory |
|
||||
|
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 |
|
||||
|
Yes. That should work.
__________________
Psychology Mental Health & Self-Help Forum Online Counseling & Therapy | Mental Health Directory |
|
||||
|
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 |
|
||||
|
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. |
|
||||
|
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 |
|
||||
|
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 |
|
|||
|
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. |
|
|||
|
Here is another sticky thread on canonicalization issue.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |