|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
Try just this rule:
Code:
RewriteBase / RewriteRule ^index\.php$ / [R=301,L] |
|
#3
|
||||
|
||||
|
I have always found success with this one:
Quote:
**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.** |
|
#4
|
|||
|
|||
|
Thanks...
.....what about getting non www to re-direct to a www?
|
|
#5
|
||||
|
||||
|
Quote:
Code:
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*)$ http://www.domain.com/$1 [R=301,L]
|
|
#6
|
|||
|
|||
|
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? |
![]() |
| Viewing: SEO Chat Forums > Other > HTML Coding > Getting rid of index.php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|