Skip to content

Tag: apache

.htaccess – Permanently redirect to root when the website is accessed with with no query string parameters?

I am using a template on my website. This template is designed in a way where everything is in the index.php file but the functions are executed based on the query string which is stick to the index.php file. I want to permanently redirect to the root when my site is accessed with index.php with no query string parameters,

how to get url last part after slash as get value in php

My url is look like: http://localhost/event_manage?slug=hello and last value as like hello So that page is in index.php when i go http://localhost/event_manage/hello and shows error because there is no folder as named hello. But i want this hello is like GET value When I go http://localhost/event_manage/hello I tried in .htaccess file: But it still shows error and couldn’t pass the

Serve file from cache folder if it exists, otherwise rewrite to “index.php” using .htaccess

Suppose in root directory I have one file (called index.php) and one folder (called caches). I want that if the file exist in caches folder serve that file (caches/xxx.html) otherwise request send to index.php. For example I will send request to server: and Apache search first in cache/. If how-to-do.html exists then send (rewrite Apache) how-to-do.html otherwise send request

.htaccess file is not working in my Server

My site is located in and I want to rewrite the URL by .htaccess file. From To but it is not working. And also To but this is also not working. I have kept my .httaccess file in /www/wwwroot/ My .htaccess file: Thank You 🙂 Answer I’m not sure that your edit made your question

Problem with ‘apache_getenv’ since upgrading to PHP 8

I’m hoping to get some help with an Apache/PHP 8 issue I’m encountering. Since upgrading to PHP 8 on my LAMP server, my logs have been outputting the following error: I’ve done a quick debug with var_dump(is_callable(‘apache_getenv’)) and the value returns as bool(false). I’ve attempted: Disabling PHP 8, restarting Apache, re-enabling PHP 8, and restarting Apache again Restarting my whole

React app not sending files to php server with Ajax

I’m hosting a react app on my apache server. I’m using react-images-upload npm package to receive an image from the user then post it to my php server with Axios. However when I check the php $_FILES array in the response it’s empty. I have tested wether my server can receive files with a little upload form on the php