.htaccess modification for subdirectory access - apache

I followed this as a solution and my .htaccess now reads:
<DirectoryMatch /mypath/to/my_subdir/(.)*/>
Options +Indexes
</DirectoryMatch>
Yet when I visit my subdir (http://www.example.org/my_sub/) I am getting the following error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster#mydomain.org to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
The .htaccess file noted above is living in /public_html/ directory.

Related

Is there a way to serve julia from the cgi-bin directory with apache?

I have a user who wants to serve output of julia files from an apache webserver.
Placing the code in there, adding .jl to AddHandler, and chmod 775 the file gets a 500 internal server error.
helloworld.jl: -rwxr-xr-x
println("hello world")
Here is what is displayed from apache:
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.```

Block access to folder and allow only from subdomain

I got a folder called roundcube and also a subdomain called webmail.domain.org. I add this code in .htaccess to block accesing to domain.org/roundcube and allow only on webmail.domain.org.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^webmail\.domain\.org$ [NC]
RewriteRule ^roundcube/$ http://webmail.domain.org [L,NC,R=301]`
Accesing domain.org/roundcube still works and webmail.domain.org gives me this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, me#domain.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
What I'm doing wrong?

.htaccess breaking my site

I'm trying to optimize my site using Google Analytic's site speed suggestions and one of the suggestions it gave me was to Leverage Browser Caching in my .htaccess file.
After doing some research on .htaccess I found that my site didn't have one. I created my own .htaccess and filled it with the below text:
AllowOverride All
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
I uploaded it to my site, and now when loading any of the pages on my site I get an error page that says the following:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, [no address given] and inform them
of the time the error occurred, and anything you might have done that may
have caused the error.
More information about this error may be available in the server error log.
Any idea what might be causing this? I'm new to this so any help would be greatly appreciated!
Remove or comment out this line
AllowOverride All
As this directive isn't allowed in htaccess. It is only allowed in Apache config, hence presence of this line is causing internal 500 error.

Apache Internal Server Error after adding htaccess to the website

I'm getting following error in my apache localhost server.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Previously it worked properly.But recently enabled the Apache Proxy Module.
Finally i could solved the issue by myself.The issue was at apache configuration file.

Apache Error directive ignoring ErrorDocument directive

I wrote on my .htaccess an if to check if the *mod_rewrite* is installed and throw error 500 if not.
ErrorDocument 500 /500.html
<IfModule !mod_rewrite.c>
Error "mod_rewrite not installed"
</IfModule>
If i get an 500 error by it will show the 500.html. But if it gets that same error from the Error directive, it will show the default error page instead. Why ? How do i fix it ?
Well, after thinking a lot about it and reading a bit, i believe that the Error function simply makes the .htaccess parsing to be cancelled - and the error to be logged - and then throw an 500 error from the apache config that has been parsed before this one (for example, an .htaccess from another folder over this one or the httpd.conf from apache)