Unstoppable Domains

Htacces default page help

Spaceship Spaceship
Watch
Impact
109
Hey all!

Well there's something I can't get past in htaccess.

Im trying to make the default page a page that doesnt really exist... The default page is index.php which exists, but I want the default page set to index.html so that it is SEO friendly, but if I set the default page is index.html I get a 404 error even after adding a Rewrite Rule to redirect all .html's to .php's

Anyone have any suggestions?

This is what I have:

Code:
RewriteEngine On
RewriteRule ^(.*).html $1.php
DirectoryIndex index.html

Thanks everyone! Any help or suggestions are much appreciated.

Regards, Rhett.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
so, what does the index.php do?

I see now, it must be that the page doesnt exist, are you using the correct capitals etc? Thats the only thing i can see.
 
Last edited:
0
•••
webmonkey said:
so, what does the index.php do?

I see now, it must be that the page doesnt exist, are you using the correct capitals etc? Thats the only thing i can see.
Hey webmonkey,

Yes the page doesnt exist, index.php exists, but not index.html.

But I am trying to make it SEO friendly, so im rewriting all links as .html, thats all done fine, only the default page is index.php, which is not as seo friendly as index.html. So if i set th default page as index.html it has an error as the file desont exist.

Know what I mean? lol.
 
0
•••
I know what you mean, maybe you should well im not sure, what about just using a seo friendly program, im sure sv will be back later. . .
 
1
•••
webmonkey said:
I know what you mean, maybe you should well im not sure, what about just using a seo friendly program, im sure sv will be back later. . .
lol ;). Yer SV'll probably turn up lol, as always. I'll look around for some seo software though. :tu:.
 
0
•••
Code:
RewriteEngine On
RewriteRule ^([_A-Za-z0-9-]+)/?\.html $1.php [L]

Try that.
 
0
•••
Dan Friedman said:
Code:
RewriteEngine On
RewriteRule ^([_A-Za-z0-9-]+)/?\.html $1.php [L]

Try that.
Hey Dan,

That part is working fine!

But when a search engine will find my website, it will go to http://www.domain.com/ which will use the default page http://www.domain.com/index.PHP instead of the rewritten http://www.domain.com/index.HTML. Im trying to get it to use the .html as its more seo friendly (having .html instead of .php). I've tried setting the default page to the index.html, but htaccess knows its not really there and has a 404 error.

Know what I mean? :D
 
0
•••
Make an index.html and set index.html to the main page.

Maybe?
 
1
•••
Make an index.html.php file.
 
0
•••
Jim_ said:
Make an index.html.php file.
Hey Jim,

But that would mean the extension is still .php which isn't seo friendly..

Im beginning to think that maybe I haven't stated mt problem clear enough lol.
 
0
•••
I understand.. try your first code but just make an index.html

And if that doesn't work try your first code but move DirectoryIndex about RewriteRule
 
0
•••
The original one you made works fine for me!
 
0
•••
OH OH OH OOOHHHH!!!!

Got it lol.

DAN you are a legend, just did what you said to (create an index.html) and it works brilliantly :tu:

NP$ sent to you + rep.

Thanks everyone else also for helping, rep left to all the people who helped that I could actually leave rep to (I couldnt with some as I had already recently).

Thanks all!
Rhett.
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back