says: "hi all,
I have some problem with my cpanel !
I have uploaded my index.html file on public_html directory.
but when I enter my url (this: http://ads1plus2.com ) in brower. it do not appear and says: "If you feel you have reached this page in error, please contact the web site owner......."
can any one help me ?
by the way the .htaccess file is OK
because the only line is:
DirectoryIndex index.html
cheers,"
can any one help me ?
by the way the .htaccess file is OK
because the only line is:
DirectoryIndex index.html
cheers,
http://ads1plus2.com/ loads the index.html page at my end, perhaps your browser is cached?
Related
OK, it's very simple but it does not work. I have a wiki site where the root contains an index.php file and the subdirectories contains the content of the wiki (I use PMwiki, so no database is required)
I want to temporarity shutdown the website and make it unaccessible by using an nice HTML page to display the shutdown message. I could rename the index.php file, but the rest of the files in the subfolder will remain accessible.
The first thing that worked but which is not elegant is restricting the whole site with a password in the htaccess using "Require valid-user" and all it's other command. The problem is that I cannot display a nice shutdown message as an HTML file.
Else I tried renaming the index.php file to something else like site.php. Creating a index.html file as a message and using a script like this:
Order Deny, allow
Deny from all
<File "index.html">
Allow from all
</File>
In that case, the index.html file is accessible, but it must be manually typed in the URL, it will not use this file by default. I tried adding DirectoryIndex directive like this
DirectoryIndex index.html
But it still does not work.
So first is there a way to make the user only see 1 page in particular and block everything else.
Second, doing so makes the site unaccessible to me. So is there a way to passords restrict the whole directory structure except for a specific index.html file. So that I could type url/site.php and be able to enter my website using an htaccess password.
Thanks for any help
Just this rule in root .htaccess should be able to handle this:
RewriteEngine On
RewriteBase /
RewriteRule !^shutdown\.html$ shutdown.html [L,NC]
Now you can keep custom HTML content in /shutdown.html. Keep in mind you need to use inline css/js since it will also rewrite css/js requests to /shutdown.html file.
This is so frustrating. My root directory is at home/websitename/websitename/ and my httpd.conf has nothing in it!
My .htaccess is in the same directory as the index.php is supposed to be and all I'm typing into .htaccess (and FTP identifies this as an HTACCESS file) is:
DirectoryIndex Home.php
The error message I get when trying to visit the site is a 403 forbidden to list the directories of "/"
the AllowOverride directive is set to All
Ok actually I made a dumb mistake.
Basically all the things one needs to check in order for the .htaccess to work are these:
Create a .htaccess file in the main directory. Make sure the .htaccess file is made in a file editor for ACSII. (notepad++, dev editor, NO Microsoft Word)
Make sure AllowOverride is set to All in the Apache configuration for your website. It should be under <directory>
Make sure to restart apache after making any changes to the Apache file!! Note that even though .htaccess does not require you to restart Apache, changing anything in the website configuration file requires you to restart Apache in order for it to function.
Lastly, your website should output a 500 Internal Apache Error if it is able to actually read the .htaccess file, NOT a 403: Access Forbidden or directory listing.
I have an Apache web server running on Amazon EC2 and I am trying to make a custom 404 page which I did, but I want it to popup when a mistyped or wrong URL is requested. This is my .htaccess code
ErrorDocument 404 /404.html
I saved my .htaccess file in my /var/www/html directory. Am I doing something wrong? Because when I typed in a wrong url, the default Apache 404 Error keeps popping up and I don't want that to drive visitors away. Is this possible? Thanks!!!
confirm that AllowOverride directive is set to All in your httpd.conf
secondly .htaccess should be kept inside the root directory of your code.
I figured it out. I used the same code:
ErrorDocument 404 /404.htmlBut instead of putting it in my .htaccess file, which never worked, I put the same code in my httpd.conf file which I found under the directory /etc/httpd/conf/httpd.conf Thanks for all your help!
I want to set intro page before my index.php page in root directory. My web server is Apache. I put this code in my htaccess file :
DirectoryIndex i.html index.php
This is i.html code:
<!DOCTYPE html>
<html>
<head>
<title>Personal Website</title>
</head>
<body>
Enter
</body>
</html>
But when I click on link , page still on i.html and I can't enter to index.php.
What is wrong?
Is there better method for this?
why dont you set index as the welcome page as it usually is then have the link to the other page ?. I cant see a lot wrong with what you have done tbh.... hmm.
Try putting index.html or index.htm and leave the htacess stuff out, as the server will usually try to open the html file before the php file.
So using index.htm or index.html usually works fine for a welcome page as you don't need to configure anything usually, just place the file there and it will override index.php as the start page.
I know this is old, but the following worked for me in a .htaccess file:
DirectoryIndex index.html index.php
FYI, the change to .htaccess does not require restarting Apache and should be immediate. You could try searching for DirectoryIndex in your .htaccess just to make sure it is not in there multiple times.
I know your question references i.html. I don't know if that makes a difference or not, but you could easily switch it to index.html to see.
I have not done any web dev before. I got my Apache server running on mac OS X, and set up a virtual host at /Users/dan/webapps. So, when I go to http://localhost/ in my browser, my index.html in the webapps folder shows up, as expected.
I then created Users/dan/webapps/temp/ folder, and put a flash app in there, let's call it "test.html", along with the required "test.swf". I restart the server. However, when i put http://localhost/temp into my browser, I get File Not Found. How do I make the browser able to go to that directory, and when it goes there, have it start test.html. I am using Safari. Thanks.
you should type: http://localhost/temp/test.html
a full path to your page,
Or you can change the name of your page from test.html to index.html and it would be loaded when you enter http://localhost/temp/, since the default DirectoryIndex is index.htm or index.html
Create a .htaccess file in Users/dan/webapps/temp/, and add the line:
DirectoryIndex test.html
This will make apache look for test.html when someone accesses the directory. Make sure permissions/ownership allows your webserver to read this file.