Edit/Change 300 Multiple Choices on Server - apache

I edited all my server http status messages...
The 300 Multiple Choice is still showing up, when I'm typing in a wrong address, so it's showing me options.
Do you know how I can get rid of that? I don't want users to have a choice. Either I want to redirect to .index.html or I want to show an own created message page with a '>Go back!' option.
Server is apache...
I would appreciate some help :) (If there's a solution for my problem)
thx ahead!

Add this to your .htaccess file:
Options -MultiViews
CheckSpelling off

I solved it a different way without using RewriteRules to fix this..
If you have index.html or index.htm as the first values in DirectoryIndex it will try to load those up first.. I put index.php as the first script to load up and the Multiple Choices 300 error went away. Although I never even had the Multiple Choices 300 error with my old configuration.. it has something to do with updating PHP to version v5.4.16 or higher.

Related

impresspages 4.0.13 linking to outside websites

On my website when using impresspages 4.0.13 when I click add link and type in, http://google.com, for example it turns it into http://glymm-mere.org/12thnight/\"http:/google.com\". Needless to say does not work, how do I fix this? I have tried reentering after the fact but it will only re correct to the bogus website link.
I had this problem also
just add this into .htacces file:
php_flag magic_quotes_gpc off
problem solved
Or just update ImpressPages. Just made ImpressPages to work even if magic quotes are on.
Please turn off magic quotes on your server.

Removing the .php file extension from files on an Apache server

My question is, I am sure, relatively straightforward and there are several questions about this exact topic already on stackoverflow. I have tried all of the solutions currently posted and none of them seem to work, this could be due to changes in the apache server over time and now it handles parsing a .htaccess file or it could be a configuration setting that isn't mentioned in the posts. Whichever the case an updated answer would be extremely helpful.
There are 2 main goals I have
1) Configure my apache server such that a link to the page [www.example.com/about] makes the web server understand that the page [www.example.com/about.php] should be rendered and shown to the user.
2) Configure my apache server such that a link to the page [www.example.com/about.php] redirects VISIBLY to [www.example.com/about] so that the user does not see the .php extension at the end of the url.
I have read through the Apache HTTP Server Version 2.4 documentation regarding mod_rewrite trying to figure out how to make this happen and I have not yet had success. I've also read through all the current posts on this topic and tried the posted solutions without luck thus far.
Any and all help will be extremely appreciated.
Thank you for your time.
For 1,
Its better to put Alias to achieve. Enter the following line to the VirtualHost container in httpd.conf
Alias /about /about.php
Then restart the httpd
For 2,
Try editing the httpd.conf and php.ini. From httpd.conf edit the following lines
ServerTokens Prod
ServerSignature Off
From php.ini edit/add the line
expose_php = Off
Let us know if that helped you :)

This web page has a redirect loop

Alright so I tried forcing either www. or allowing without the www. . It wasn't working so I took it all out of the .htaccess file and re-uploaded. Now when I try to view the website I get the error message of:
This web page has a redirect loop
How long does this take to refresh and not display this error message anymore? I tried clearing my cookies and flushing my DNS. It's still there.
Thank you!
Maybe have a look at this previous question's answers: How long does it take for .htaccess changes to take effect?
Changes to .htaccess should take effect immediately. It might help to re-check the obvious things (that the file on the server is indeed the correct .htaccess, etc)
Apache's help page on the matter: http://httpd.apache.org/docs/2.2/configuring.html#htaccess

mod_rewrite not working?

So I'm trying to get mod_rewrite to work, using Apache2.2 on windows 7
I'm running it as a local server.
All sites are accessed at http://localhost/
It's not working?
I created a simple .htaccess file and it won't work.
in the httpd.conf I changed it to
Options All
AllowOverride ALL
Whats the problem?
Try writing garbage in your .htaccess file. This should cause a 5xx error message. If it does not then your AllowOverride All is at the wrong place in your config.
I would also suggest adding a (name based) virtualhost to keep your configuration at one place instead of modifying the defaults.
Just want to add to the above which is correct, I was also pulling my hair on a non-working .htaccess. After hours of testing and troubleshooting it turned out that, even though my Sublime Text 2 was set to UTF-8, somehow it was still carrying over hidden special characters that were the root cause of my problem. After copying & pasting .htaccess' contents into vim editor, removing those weird characters, then resaving things started working as should.

Give 404 on existing folder/directory

I have a folder in my root that i want no one to know of. Even if someone types in it correct i want to throw a 404 not found.
Would this be Possible to do with mod-rewrite perhaps?
I cant store it outside root right now, dont ask why
Thanks!
Is throwing a 403 out of the question? If you have shell access, you can chmod the directory so the web user cannot read or stat it.
Create a custom 404 page and then set mod_rewrite up to rewrite requests to the offending directory to the custom 404 file. Custom 404 pages are generally good practice anyway so you get two for the price of one by doing this.
I'd first suggest moving the file out of the web root, unless you have a really good reason not to (and I won't easily be convinced that you do).
If you're intent on not doing that, use Tristan's suggestion of a 403 error. Something like
<Files /path/to/docroot/nameoffile>
Order allow,deny
Deny from all
</Files>
If you're really intent on not doing that, you should be able to use an alias to redirect the URL to a nonexistent location:
Alias /nameoffile /path/that/doesnt/exist
The same could be done with mod_rewrite,
RewriteRule /nameoffile /path/that/doesnt/exist [L]
The rewrite is more computationally expensive, but it might be your only option if you don't have access to the main server configuration.
I did not try this, but I guess you could redirect to something that does not exist.