htaccess show internal server error - .htaccess

i have facing some problem in htaccess i can't understand what the issue is that .. i would like to make SEO friendly URLs but when i write RewriteEngine on given error show on website
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin#localhost 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.
my website folder are.
- includes
- logs
- public
and .htaccess file available on main.
and index.php available in public folder .
and htaccess file i was put in public folder same error show.
In Include folder all class has been defined.
In public folder all publicily available pages
htaccess File Code is :
RewriteEngine on

Your server doesn't have the rewrite module loaded. You'll need to make sure this is installed and that your server is configured to load it. How you do this depends on which operating system you use.
If you are using a hosting provider rather than your own server, it is likely you don't have the access necessary to do this, in this case, contact support and ask them about it.

Related

Troubleshooting htacess edits to whitelist .well-known folder for let's encrypt challenge Drupal 7

I need to prove ownership of SSL in order to switch hosts and reroute DNS. I have the file in the .well-known/acme-challenge/ folder, but the folder is 403 forbidden so the test fails. The site is running Drupal 7 and I have the lets encrypt challenge module installed as well
I have tried editing the .htaccess to add RewriteRule "(^|/)\.(?!well-known)" - [F] but this has no effect. I have tested the .htaccess file by adding junk text and did get the 500 error, so I know it is being used. What could be getting in the way of this edit? Do I need to restart a process on the server?
I solved this by finding the .httpdconf for the domain on the server (not the main one for the server) and adding a clause to allow specific access to that directory.
The verification files were then able to be found and site is launched now on new host and server.

Forward request to virtual directory to an internal web server using IIS7 URL Rewrite

I have an IIS server that is currently only accessible internally to our network and I would like to be able to access some files on it via a folder on our public website.
I would like it to work like the following:
user requests http://www.example-1.com/server2/[filename] from IIS server 1
Server 1 retrieves the file from the internal IIS server 2 at
http://www.example2/[filename]
Server 1 IIS then sends the file to the user.
NOTE: User CANNOT access http://www.example-2.com/[filename] directly. Only the first IIS server has access.
Here is the steps I have taken to do this:
I created a virtual folder in the root of our public website named "server1"
I then selected URL Rewrite in the IIS manager on this new virtual folder
I then created the rule as shown below:
I am currently recieveing a 404 error when I try to access a file at:
http://www.example-1.com/server2/test.jpg
I can verify the file is there by remoteing into web server one and browsing to:
http://www.example-2/test.jpg
This shows the test image.
I feel the problem must somehow be related to my URL rewrite rule.
If someone could offer advice on this issue I would greatly appreciate it as I have never used the URL Rewrite module before.
Thank you!
I have found the solution!
I was very close but I made a key mistake...
Instead of using a Blank Rule I needed to use a "Reverse Proxy" rule in IIS 7 URL Rewriting.
I created this Reverse Proxy rule on the /server2/ folder.
This works perfectly!

.htaccess to limit access to directory not working properly

I'm trying to limit access to a directory based on the results of a php script. I have the following in my .htaccess folder where the files are located:
RewriteCond %{REQUEST_URI} !=league_access.php
RewriteRule .* league_access.php
I have also tried:
RewriteEngine on
RewriteRule .* league_access.php
If you go to the directory http://www.bowling-tracker.com/bowl/league_documents/1/ you will note that it is firing the league_access.php script (as it currently only types "Running the Test Script
Restricted access" to the page.
So that is acting correctly.
http://www.bowling-tracker.com/bowl/league_documents/1/test.html you will see that you're granted access to the page (rather than it going to the league_access.php script).
This website is on FastComet (public hosting company) so I cannot change server settings or files except the .htaccess file.
Any help to resolve this would be greatly appreciated.
Thanks....
FastComet Team here! Part of our shared hosting environment is utilizing NginX as a reverse proxy to the Apache web service. This configuration gets the advantages of both services at the same time and ensures a better performance of your project. NginX is processing all requests for static content, such as PDF files or HTML pages. Here's a list of all file types that will be processed by the NginX service:
3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso
However, if the request is for dynamic content, such as a PHP script, it will be passed from the NginX to the Apache service. You are correctly setting the rule in question in the .htaccess file of your website, but this file is only read by the Apache service, not NginX. In other words, if there is a request for a static content, such as a PDF file here:
http://www.bowling-tracker.com/bowl/league_documents/1/Rules_Thurs_Night_Mixed.pdf
or an HTML page here:
http://www.bowling-tracker.com/bowl/league_documents/1/test.html
it will be processed by NginX without considering the .htaccess rules that you have set. There is an easy way of resolving that by excluding the processing of HTML, HTM and PDF types files for your domain or even your entire hosting account. This way, those requests will be processed by the Apache web server, instead of NginX. In this case, the .htaccess rules that you apply will be taken into consideration by the system and they will work without any issues.

Joomla : whenever i change URL rewriting and enable htaccess get error

My site was working fine for the last couple of months and suddenly stopped working. and the issue was backend was working fine but the front end does not load at all.
then I contacted server providers they saying they have not done any changes to the server and asking me to contact Joomla support to see any in-depth errors. they even said they cant find any issues from the logs.
Then what I did was I reinstall VirtueMart (mind you this is an e-commerce site). then it started to work again from the front end. but I realize follow on pages aren't working. so what I did was I remove url re-writing and change the .htaccess code to txt.
so the issue I am having now is I can see index.php file in the URL. but whenever I try to change use url rewriting and enable .htaccess I get 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, webmaster#domain.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
anyone have any ideas?
Suddenly stopped working, without any change from your end ?
Try to step backward and recall anything you did before the issues.
The virtuemart re-installation should not have any relation with the SEF settings and the htaccess.
All these seem to be a combination of different issues.
Have you made any changes on the htaccess file ?
Go in Joomla Global configuration and disable SEF settings. Set URL rewriting to No. Then try to load pages in the front-end.
If you need SEF URLs, follow these instructions about how to enable this feature in Joomla:
http://docs.joomla.org/Enabling_Search_Engine_Friendly_(SEF)_URLs

Access denied on 1&1 server

I am having a problem with hosting a website on a 1&1 server (Bought package is SmartWeb M). I uploaded everything to the public_html folder (before you ask - yes, index.html is located in the document root and not one of the subfolders). When I then try to call the page in a browser I get the following error:
Forbidden
You don't have permission to access /index.html on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Since I couldn't find any .htaccess on forehand I created one in hope that that would fix it - nothing.
I have been waiting for an answer from the 1&1 help desk in more than 3 days now and I am moderately angry at their service.
Could anyone help me with this?
Thanks!
It turns out, that my files did have the wrong permissions. Make sure to get them to -755!

Resources