index.html works, index.php does not.

Status
Not open for further replies.

masalon

New Member
Messages
8
Reaction score
0
Points
0
http://www.michaelalexandersalon.com

I want to use my index.php file as my index.

if I have an index.HTML file present, it works just fine. That is the case right now. If you go to the site, you will see it with the word "test".

If I delete the index.html, I get the 404.

if I go to http://www.michaelalexandersalon.com/index.php, I get a 404.

if I edit my .htaccess to make index.PHP have priority over index.html, and go to http://www.michaelalexandersalon.com, I get the 404.

I know that PHP is working. go to http://www.michaelalexandersalon.com/concrete/dispatcher.php and you will get an access denied message which is what you should get.

What gives?


edit: here is my .htaccess
Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} ^michaelalexandersalon\.com$ [NC]
RewriteRule ^.*$ http://www.michaelalexandersalon.com%{REQUEST_URI} [R=permanent,L]

ErrorDocument 400 /
ErrorDocument 401 /
ErrorDocument 403 /
ErrorDocument 404 /
ErrorDocument 500 /
 
Last edited:

zapzack

New Member
Messages
606
Reaction score
19
Points
0
why is the www so important? anyways.. Try this:

Code:
RewriteEngine On

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

ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php
 

masalon

New Member
Messages
8
Reaction score
0
Points
0
DirectoryIndex index.php index.html index.htm

I mentioned that I've tried that. It gives me a 404.



why is the www so important? anyways.. Try this:

Code:
RewriteEngine On

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

ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 500 /index.php

It's not important. I just prefer it that way. I made the change and still no dice, thanks though.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83

You should only get a 404 here if the file index.php does not exist.

Are you sure the file name is spelled correctly?

Do you do something special in index.php, like a redirect or use frames?

Add: Just notice the above url gets redirected to

Code:
http://michaelalexandersalon.x10hosting.com/index.php

which gives the 404, but trying

Code:
http://www.michaelalexandersalon.com/garbage.php

does not get redirected, but displays index.html as the 404 error page.

What are you doing in index.php ?
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
DirectoryIndex won't apply when the URI denotes a file. If http://www.michaelalexandersalon.com/index.php results in a 404, it's because either there is no index.php in the document root, the URL gets rewritten to point to a non-existent file (which the lone RewriteRule given won't do) or accessing index.php results in another status, but the server is configured to return a 404 instead (the given configuration is not set up this way; a common scenario is to return 404 rather than 403). Check that index.php is present and readable (mode 0600 should be sufficient).

@zapzack: As for forcing the "www", subdomains with duplicate content can affect a site's ranking in search engine results.
 

zapzack

New Member
Messages
606
Reaction score
19
Points
0
Why doesn't he just park the domain in cPanel and forget all his hassels.. Instead, he is just redirecting to x10..
 

masalon

New Member
Messages
8
Reaction score
0
Points
0
I figured it out. I am using Concrete5 CMS and when I initially configured it I set my base URL as the x10hosting one. I finally remembered that and realized that was the only way it could be redirecting. Went in and changed the URL in a c5 config file and all is well. ;)
 
Status
Not open for further replies.
Top