HTML Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsOtherHTML Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old March 4th, 2008, 07:31 PM
badmaash badmaash is offline
Permanently Banned
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 31 badmaash Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 11 h 28 m 11 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Send a message via ICQ to badmaash
Getting rid of index.php

I have added the following code to my .htaccess :

rewritecond %{THE_REQUEST} ^GET\ .*/index\.(php|html)\ HTTP
rewriterule ^(.*)index\.(php|html)$ /$1 [R=301,L]

but when I click on a link to go to the home page:

href="./index.php"

I still get domain.com/index.php

I thought it should have got rid of the index.php

Any ideas?

Reply With Quote
  #2  
Old March 7th, 2008, 08:17 AM
sparrowhawk's Avatar
sparrowhawk sparrowhawk is offline
parenthetical over-user
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: (US) New Hampshire
Posts: 409 sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 15 h 28 m 21 sec
Reputation Power: 7
Try just this rule:

Code:
RewriteBase /
RewriteRule ^index\.php$ / [R=301,L]
__________________
Ubuntu Linux .::. SEO Chat FAQs

Reply With Quote
  #3  
Old March 7th, 2008, 11:58 AM
pro_seo's Avatar
pro_seo pro_seo is online now
Moderator
SEO Chat Frequenter (2500 - 2999 posts)
 
Join Date: Apr 2006
Location: I N D I A
Posts: 2,605 pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level)pro_seo User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 21 h 45 m 40 sec
Reputation Power: 30
Send a message via AIM to pro_seo Send a message via MSN to pro_seo Send a message via Yahoo to pro_seo Send a message via Google Talk to pro_seo Send a message via Skype to pro_seo
I have always found success with this one:

Quote:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://www.domain.com/$1 [R=301,L]



**Replace domain.com with your real website URL
__________________

Social Mobile Messaging
SEO FAQs - You might find your answer here.
SEOchat Forum Rules - Read Before You Post


**Do what you feel in your heart to be right- for you'll be criticized anyway. You'll be damned if you do, and damned if you don't.**

Reply With Quote
  #4  
Old March 7th, 2008, 01:31 PM
badmaash badmaash is offline
Permanently Banned
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 31 badmaash Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 11 h 28 m 11 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Send a message via ICQ to badmaash
Thanks...

.....what about getting non www to re-direct to a www?

Reply With Quote
  #5  
Old March 7th, 2008, 01:34 PM
sparrowhawk's Avatar
sparrowhawk sparrowhawk is offline
parenthetical over-user
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: (US) New Hampshire
Posts: 409 sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 15 h 28 m 21 sec
Reputation Power: 7
Quote:
Originally Posted by badmaash
.....what about getting non www to re-direct to a www?
Code:
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*)$ http://www.domain.com/$1 [R=301,L]

Reply With Quote
  #6  
Old March 9th, 2008, 07:29 AM
badmaash badmaash is offline
Permanently Banned
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 31 badmaash Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 11 h 28 m 11 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Send a message via ICQ to badmaash
Thanks...

....I am on a virtual server and the .htaccess file is the same for all the domains on my server.

So I added the rewrite for a sub.domain to www.sub.domain and it worked for my subdomian. I then tried to apply the same rule for my main domain by adding the same code to the htaccess file but it does not redirect.

Any idea?

Reply With Quote
Reply

Viewing: SEO Chat ForumsOtherHTML Coding > Getting rid of index.php


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway