All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Apache - How to compress (gzip) only specific calls

I have PHP application served with Apache 2.4 I need the apache to compress (mod_deflate - gzip) calls for specific users. So the application should decides dynamically which calls gets gzipped. I was ...
Niro's user avatar
  • 1,431
0 votes
0 answers
39 views

I want to add a custom 404 to all my URLs following a relevant pattern using .htaccess file

Hello, Google is currently indexing query string URLs of my website. Google has currently indexed almost 112k URLs that all of are duplicate versions of other URLs causing my website to slow down and ...
mehtab fatima's user avatar
1 vote
1 answer
146 views

What determines the name of Apache PHP Handlers?

When configuring an Apache server to use a Handler to run PHP code, I'm familiar with adding a line similar to below in httpd.conf or .htaccess: AddHandler application/x-httpd-php81 .php This tells ...
frumious's user avatar
  • 123
0 votes
0 answers
47 views

How to server index.php from different directory through .htaccess?

I am working on a project which is in Yii2. I have to integrate swagger UI for API documentation. My current directory structure: This is what the .htaccess looks like: RewriteEngine on RewriteCond %{...
Paresh Maheshwari's user avatar
0 votes
0 answers
158 views

$_POST is empty when obtaining in "ErrorDocument 404" (nginx + apache + mod_php)

I try to transfer website from old server to new, and stucked with one problem. PHP/JS code on both servers is the same, but on new server it is not working - $_POST data are empty in AJAX-request. ...
Ipromo's user avatar
  • 1
0 votes
0 answers
152 views

URL Shows 404 but adding .php at the end displays

I have set up this website and it's working perfectly, however, extensions such as domain.com/dashboard will display a 404 but when I add .PHP at the back -> domain.com/dashboard.php it displays. ...
Brun0L3z's user avatar
0 votes
2 answers
588 views

How to block potential attackers on my server

To keep it brief and simple, I will go straight to the point. It seems a bunch of ip adresses are trying to access files that have potential of containing sensitive server information on my website ...
Dennisrec's user avatar
  • 121
1 vote
1 answer
991 views

.htaccess Remove first php url parameter if second exist

This is my .htaccess code: RewriteCond %{REQUEST_URI} !^/pages/ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)(/([^/]+))? pages.php?PAGE=$1&LINK=$...
Adrian's user avatar
  • 11
2 votes
1 answer
737 views

used colons for url htaccess http://localhost/1:1

I have a problem with the colons used in url this my url http://localhost/1:1 this my htaccess RewriteEngine On RewriteRule ^/(.*):(.*) index.php/$1:$2 this error show Forbidden You don't have ...
amir shariflou's user avatar
0 votes
1 answer
42 views

How to redirect search.php?query=test&search=1&s=1 to /query/test

I have tried other things, but I cannnot get it to work, when I go to the main website, (index.php is just a include of search.php) it will send me to this /query/search.php/search.php/search.php/...
Nate Sturtz's user avatar
1 vote
1 answer
45 views

PHP processing pages for forms not following line with rest of files

I'm a web developer hobbyist. I'm over 50, never had a true web dev job but like to tinker in my spare time for fun. That said, I have a web site hosted by Bluehost that I wrote with PHP from scratch. ...
Bob Todd's user avatar
1 vote
1 answer
2k views

CORS conflict after enabling FPM in PHP

In the .htaccess file on my web server, I have the following CORS header set: Header set Access-Control-Allow-Origin "example.com" In one of my PHP scripts, that I frequently call while ...
XtevensChannel's user avatar
0 votes
3 answers
3k views

How to tell .htaccess to only allow requests to index.php and app/dist/* folder?

This is the current folder: /app /dist /index.html /index.css /index.js /src /configurations.json /index.php /configurations.php I have sensitive data everywhere: app/src/... /......
Carl Gentleman's user avatar
1 vote
1 answer
2k views

.htaccess issue php $_SERVER['PATH_INFO'] is empty [closed]

On local host I was running my php (MVC) application with following rules in my .htaccess file: Options -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-...
Bipul Roy's user avatar
  • 113
2 votes
1 answer
7k views

(proxy_fcgi:error) AH01071: Got error 'Unable to open primary script:' (No such file or directory)

X-post from StackOverflow I've read countless forum posts about this but none of the answers seem to help my situation. Here's the log excerpt: [proxy_fcgi:error] [pid XXXX] [client redacted] ...
JakeTheSnake's user avatar
1 vote
1 answer
1k views

.htaccess write commands if hostname equals to

It is possible write any kind of condition (IF) in .htaccess to apply some specific actions ? #if hostname = xxx then php_flag display_errors on php_flag display_startup_errors ...
MCunha98's user avatar
2 votes
1 answer
3k views

Get variables become inaccessible after htaccess rewrite

I'm trying to work with SEO friendly urls and as a result am using htaccess to redirect to a more friendly destination. However, when I do these redirects, I am no longer able to access the get ...
Navid Boloorian's user avatar
0 votes
0 answers
242 views

SAFARI error white page with symfony and htaccess with php-fpm all work on chrome,IE, firefox

I have a problem i just finish and upload my site but he not work with safari got white page i check log [Thu May 16 07:56:17.534196 2019] [authz_core:debug] [pid 5671] mod_authz_core.c(820): [client ...
Jonny's user avatar
  • 1
1 vote
0 answers
892 views

Apache appears to be ignoring my .htaccess file, despite mod_rewrite being enabled and AllowOveride all

System specifications: Amazon Linux AMI release 2017.03 Apache/2.4.33 (Amazon) PHP 5.6.36 DNS is handled by Cloudflare Here are my VirtualHosts: <VirtualHost *:80> DocumentRoot "/var/www/...
jvnk's user avatar
  • 123
4 votes
1 answer
11k views

AddType application/x-httpd-php .html stopped working

I have the following line in .htaccess AddType application/x-httpd-php .html .htm And it used to work for years to treat html pages as php, however recently I noticed it is not working anymore, ...
Mike's user avatar
  • 143
1 vote
1 answer
987 views

RewriteRule is not working when index.php is clicked

RewriteRule is not working when index.php is clicked. Below is my code : RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^home$ /index.php [L] ...
Suneet's user avatar
  • 35
2 votes
1 answer
2k views

Multiple RewriteRule in htaccess not working

I am very well aware that such type questions have already been asked many times but I think mine is a different one. I am a newbee to .htaccess. RewriteEngine On RewriteBase / RewriteCond %{...
Suneet's user avatar
  • 35
0 votes
0 answers
15 views

Conflicts between htaccess rules [duplicate]

I'm trying to use the url_rewrite system for php but, as i'm a rookie i have a conflict problem (i suppose) between rules. I have these three htaccess rules. The first two are working, the last one ...
Ogum's user avatar
  • 101
0 votes
2 answers
1k views

Using deny from all inside htaccess in a subdomain restrict access to itself

I am facing a strange situation where i couldn't find a proper answer to. I am using some kind of an API where i can send responses to certain requests from the same root domain. My api is in a ...
Rüzgar's user avatar
  • 101
1 vote
0 answers
397 views

Trying to update PHP servers to PHP7-cgi (7.2)

I'm Trying to update PHP servers to php7-cgi (7.2) in my .htaccess file. Just not sure how exactly to edit the code, haven't been able to get it to work. Here is the code in the .htaccess file: ...
jessica's user avatar
  • 11
1 vote
1 answer
3k views

Error 403 (access denied) with updated .htaccess file

Im using a plugin for one of my websites which I have updated recently. Since I have updated I get always an access denied message (Error 403) when opening magnalister.php of the plugin. When I ...
TmCrafz's user avatar
  • 139
1 vote
1 answer
1k views

Finding the source of a 301 redirect (through .htaccess or wp_redirect()

One of my interns applied a 301 redirect on one of the site's pages (domain.com/nice-page) to another page (domain.com/pretty-page) and I'd like to remove that redirect. The problem is that he is ...
Naser Mohd Baig's user avatar
0 votes
1 answer
484 views

Phpmyadmin setup "allow from" and ".htaccess password" not working together

Im following this tutorial from digitalocean and i have sucessfully setup the require ip and allow ip so that only my ip address can connect to the webpage. However, on the last part setting up the ...
Leon W's user avatar
  • 115
1 vote
1 answer
432 views

PHP + mod_fastcgi + suexec can't read vars set via SetEnv in .htaccess

We have PHP running via mod_fastcgi + suexec and it seems that PHP processes run this way don't see environment variables set via SetEnv in a .htaccess file. I checked via a perl script and a shell ...
user2845840's user avatar
1 vote
1 answer
70 views

PHP Dynamically generating redirects

I've recently moved all my of my rules from a .htacess file into a .conf file. Now when I want to add a redirect rule to my website I have to edit the .conf file and sudo apachectl graceful. I've ...
Chud37's user avatar
  • 123
3 votes
1 answer
7k views

How to block website for all countries except US and Canada

I have a website which is only for US and Canada visitors. I don't want to make it visible to other visitors. I want to use Geo targeting solution but I have a amazon hosting it did return current ...
Dileep Kumar's user avatar
0 votes
1 answer
310 views

Multi-User Server ; Basic Authentication ; User 1 Can Access User 2s Folder After Logging In To His Own and Backtracking

I have an Apache 2.4 server running with PHP and MySQL included. I have pages that are restricted (or are supposed to be) to certain users only. Each user has their own restricted page and must supply ...
Alex Schneider's user avatar
4 votes
1 answer
3k views

Nginx: config set up to make extensionless php pages work

I am trying to set up my first website with nginx and I cannot seem to make extensionless php pages to work. I would like my pages like /aboutme.php to appear as /aboutme or I would like to just ...
Carol's user avatar
  • 41
1 vote
1 answer
948 views

How to downgrade PHP to version 5.5 from .htaccess

I had previously PHP 5.5 installed on my Ubuntu VPS and I upgraded to PHP7.1 by install PHP 7.1, Disabling the php5.5 and enabling the php7.1 module. Its working fine but I want to run php5.5 in some ...
user3601213's user avatar
1 vote
1 answer
745 views

Apache2 give access to specific locations (.htaccess file)

Could someone help me with making a .htaccess file or how can i limit access to specific locations. All my user accessible files are located in /var/www/website however I also have some more folders ...
ACristian24's user avatar
1 vote
1 answer
2k views

Why HTACCESS RewriteCond %{HTTP_COOKIE} only for php and not working for html?

I was trying to redirect all direct access in my subfolder using this code RewriteEngine on RewriteCond %{HTTP_COOKIE} !user_cookie=[^;] RewriteRule .* http://webhost.org/ [R=301,L] I realise it ...
MyFault's user avatar
  • 11
0 votes
1 answer
385 views

is it a security risk to have php files with config in the public folder?

There is a config.php in my root folder. Users can access domain.com/config.php However the file does not echo/print any of the config. Do I still need to deny in some .htaccess rule, or is it safe as ...
Chris's user avatar
  • 173
0 votes
1 answer
1k views

Custom 401 error page served by Apache for firefox by not IE or Chrome Kerberos Authorization

I have a Intranet site that is using Kerberos Authentication. I am having issues when the user is not allowed access In Firefox the ErrorDocument 401 set in .htaccess works but in IE/EDGE/CHROME you ...
Matt_J's user avatar
  • 1
0 votes
1 answer
2k views

How do I find where the 301 redirect is for this error loop?

I am getting redirect loop / endless chain and I cannot figure it out. I'm very new to programming and servers so please help someone very green! Here is what I have so far: .htaccess <IfModule ...
JustLearninThisStuff's user avatar
3 votes
0 answers
710 views

php_value overrides with Apache using a front controller

I am trying to set specific server side value for virtual paths used to upload files. All my URLs are virtual and requested are dispatched by a front controller. I have the following config in my ...
Nicolas Bouvrette's user avatar
2 votes
1 answer
482 views

.htaccess file redirects to wrong destination

I have a LAMP stack. I'm using the following .htaccess file to automatically map requests to .php files: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] So if I browse to ...
Ryan Griggs's user avatar
0 votes
1 answer
3k views

HTML5 wont process/parse as PHP7/PHP

So i had to reconfigure my linux server because i migrated it to another system and decided to set it up from scratch just for fun and practice. Only issue is that now my LAMP is running with PHP7 ...
xR34P3Rx's user avatar
  • 197
1 vote
1 answer
2k views

Trouble with htaccess multiple rewrite rules

I have a below criteria If a query string matches Microwave_Ovens text I need to replace with Microwave-Ovens (replace underscore by hyphen) in Request URI. It is working as expected for the first ...
Lalitha's user avatar
  • 25
1 vote
2 answers
83 views

HTTPS redirect failing for some URLs but not others

Redirection from HTTP to HTTPS happens correctly when the URL is any of the following: http://example.com >> https://example.com [OK] http://www.example.com >> https://example.com [OK] http://www....
eric's user avatar
  • 133
2 votes
1 answer
299 views

Pretty URL server side configuration?

I have transferred a website to our new VPS. It worked fine on the old server. I think I know what is causing the problem but don't know where to fix it. I've read a lot of the posts about pretty ...
William's user avatar
  • 23
1 vote
1 answer
138 views

.htaccess and php configuration

I'm having some trouble to get the right config for .htaccess file. I made a small site using mvc pattern and all urls look like site.com/appname/public/index.php?param=page. I'm trying to get all ...
dan_ff's user avatar
  • 11
1 vote
1 answer
3k views

How to allow to change php version via .htaccess in Apache?

I've a Centos 7 with Apache, I want to compile php 7.0 and 5.6 and configure that as PHP-FPM. How can I configure Apache to allow users to change php version using .htaccess? Example .htaccess entry: ...
Janek's user avatar
  • 15
2 votes
2 answers
4k views

Cannot load mod_rewrite Apache module

I am trying to use mod_rewrite module of Apache24 server, but I am not being able to load it. I know there have been many questions asked regarding this topic and I have gone through all of them but ...
neophyte's user avatar
  • 133
2 votes
1 answer
114 views

How to rewrite a user from a non rewritten url to a rewritten url

I have two URLs. One looks like this way (which is a non rewritten URL): www.example.com/article.php?id=12 And the next one is looks like this (which is a rewritten URL): www.example.com/article/12 ...
arunwebber's user avatar
3 votes
1 answer
14k views

Changing session.save_path in php.ini not working

Fedora 25 + PHP 7 + Apache 2.4.23 Hello, after I change session.save_path in php.ini and restart apache, I can successfully verify that it's modified with: $ php -i | grep session.save_path However,...
synkro's user avatar
  • 223

1
2 3 4 5