Internal Server Error when using .access file - internal

I am trying to make A vanity urls but for some reason when i add the .htaccess to my local machine. Im getting
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, admin#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.
I'm using wamp, Yes I have ticked mod_rewrite and tries adding it manually still no luck?
what could it be doing this.
Heres the code
**********
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^(.*)$ [http://localhostpath/file.php?u=$] [NC]
**********
Ive tried everything possible and by googling results.

Firstly, take out the asteriks (top line and bottom line). I just tried it on my server to make sure - they're not valid comments/decoration.
Secondly, I don't know why but when I copy your code directly, I get an error. If I retype it out exactly, it works. I really have no idea what this might be, although once I had a similar issue - where the code looked the same - but it turns out something was encoded differently/corrupted (although notepad++ was still able to figure it out, apache wasn't). So just try typing it out yourself.

Related

oddness with http to https through .htaccess

So I put these commands in my .htaccess file
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
and something peculiar happened. In my HostGator access logs, I never saw reportage of download success (as in Apache code 200). I seemed to get mainly 301 redirect notifications. That is, people were downloading stuff fine, but I never saw any indication of that in my access logs. Can someone explain to me why that is? I am an Apache novice, so pardon my misunderstanding.
I removed those lines and, yep, all my expected code 200 notifications returned.

WP-cerber blocks IP : "We’re sorry, you are not allowed to proceed. Our server stopped processing your request..."

I'm using 'Redirection' plugin to redirect old website URLs to new website.
There are some URLs with .aspx pages and these URLs are blocked by WP-cerber plugin.
Error shown on browser:
"We’re sorry, you are not allowed to proceed
Our server stopped processing your request. Your request looks suspicious or similar to automated requests from spam posting software.
If you believe you should be able to perform this request, please let us know."
In wp-cerber dashboard that list events, my IP show with this message: Probing for vulnerable PHP code – Locked out
I’m using custom login field “sky”.
Any clue?
I didn't get any luck with the issue of wp-cerber plugin, but here is my solution with HTACCESS file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
RewriteRule ^(.*)$ https://newsite.com/$1 [L,R=301,NC]
Redirect 301 /xxx/xxx.aspx https://newsite.com/
That happens because: 1) there are no such pages on your website and 2) the requested pages have an extension that allows executing them on the server. So the plugin suspects that some bot or hacker tries to find vulnerable/insecure code to exploit it. Anyway, you can ignore that.

Can not log in to Drupal 7 admin after changing to HTTPS. Access Denied and cookie not set

I can no longer log into Drupal 7's admin area after adding SSL certificate and forcing HTTPS in url.
The website was previously served via HTTP protocol and worked perfectly fine. I would also like to mention that if I revert back to HTTP mode, the site will work as expected. However, I am trying to implement HTTPS.
Additionally, while logging in, I have noticed that the cookie response would be sent by the server but it would get deleted immediately leading to access denied message.
So far, after going through mixed response in the internet, I have played around with session.cookie, $base_url and $cookie_domain variables within settings.php file. I haven't found a solution yet.
Has anyone bumped into this problem? Your response will be highly appreciated.
In apache server
Go to .httaccess
Add # in front of RewriteRule ^ - [E=protossl] to disable http
It looks like this # RewriteRule ^ - [E=protossl]
This solves the problem
Ok so this is a fairly old post but here is what happened with my site.
We installed a new SSL certificate and somehow the .htaccess file ended up empty, and I do mean 100% blank.
This means easy fix, download latest drupal core and just replace the .htaccess file along with the core files, usually you want skip this to preserve all additional code added for html compression and such, but in this case that is redundant.
After the .htaccess was replaced I then added the compression and rerouting code like before and problem solved.
Hope this helps someone else out, I know I will always be checking the .htaccess files first if it happens again.
Disable in .httaccess
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com*
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

I want to block a certain url, what kind of condition do I have to write in .htaccess

There's a critical security breach in Revolution Slider, a plugin for WordPress. It works by accessing a certain URL that let's download the config files eg.
www.domain.com/wp-admin/admin-ajax.php?action=revslider_show_image&img=../wp-config.php
I've been trying to make a rewrite condition so that url wouldn't be accessible anymore. This is what I have now in my .htaccess file
RewriteEngine on
RewriteCond %{QUERY_STRING} ^action=revslider_show_image&img=(&.*)?$ [NC]
RewriteRule ^wp-admin/admin-ajax\.php$ /?%1 [R=301,NE,NC,L]
but it doen't work, I'm not very familiar with rewrites, any suggestions on what I'm doing wrong here?
Instead of redirecting to protected file, you should forbid it (with F flag, equivalent to 403).
Also, you have an error in your condition's pattern.
Put this code in your htaccess before Wordpress' main rule
RewriteCond %{QUERY_STRING} ^action=revslider_show_image&img=[^&]*$ [NC]
RewriteRule ^wp-admin/admin-ajax\.php$ - [F]
Justin's answer will work and directly answers your "how do i" question, BUT...
This will prevent Rev Slider from working entirely, since you're forbidding the ajax call which is used to get and display an image.
I know you're looking for a quick fix until you get the plugin updated (which I did confirm myself today, patching to 4.6 works just fine), but be careful about HOW you're doing it. The best thing for you to do is update the plugin, not to implement this.

"No input file specified" Error in WordPress

I am working on this site Backend works fine. IN the front end none of the other pages are displayed except index page. the error come "No input file specified"
Thanks for your help
In my case it was the presence of a file named .user.ini
Just deleted it.
This is a problem with your .htaccess file.
The fix:
Update to the latest WordPress. There is a permalink bug in some installations.
Make sure Apache is configured properly for ModRewrite.
From Support: On Options > Permalinks, is a section "Optional". It's not SO optional. After upgrading it mentioned for category's index.php/file (I've got the PATHINFO permalinks), I don't want "files" so I altered that to index.php/ Now that I've changed to index.php/_/ (or leave it blank which gives the standard "Category" subpath), its all working again. Here is the Mod Rewrite file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I got the same error.
On this server i have some about 70 WP instalation.
Whit one i got the same problem.
FIX - CTRL + F5 a few times ... and it works!
Check your PHP version! I update my php from 5.4.45 to 7.2.14 and my wordpress pulled up
In my case it turned out to be bad permissions / ownership on the public_html files. The error message is really not very helpful.
There are any number of reasons that you could get the "no input file specified" error on WordPress.
In my case, it was because I was using php-fpm and I had specified the docroot incorrectly in the php-fpm pool configuration file. But that would probably be more likely to cause it for all pages, not just the front end pages.
In other cases, it might be a problem with either the Apache vhost configuration or the .htaccess as others have suggested.
File permissions also makes sense. Here's a link with more info on that in the nginx context: https://blog.martinfjordvald.com/2011/01/no-input-file-specified-with-php-and-nginx/
If it's related to permalinks, you may be able to go to the Permalinks section in the backend and rebuild those (as long as .htaccess is writable by your web server user).
Basically, I think the error is just saying "For some reason, I can't find the file that you are asking me to look for." But it isn't given the standard 404 ErrorDocument that Apache would give so it is confusing.
According to this answer on StackOverflow, this only happens when PHP is running under CGI or FastCGI: https://stackoverflow.com/a/14578219/263877. That's why it was unfamiliar to me, since I was used to mod_php.
I had this issue and it ended up being an issue with my php configuration. After rebuilding the php.ini, my site then pulled up.
I also had the same issue after a migration from a WordPress to a new wordpress (website recreated completely)
I’ve made a migration of the datas wth wp-migrate-pro.
iTheme Security was installed on the older WordPress ans was not deactivated. So the migration ended up with this error message.
I start all over again (and deactivated iTheme Security before the migration of the datas with wp-migrate-pro)

Resources