Php – .htaccess and session start
I'm a newbie to .htaccess and came across a a line that I think needs to be in the htaccess file. That lines reads "php_value session.auto_start 1." If I understand correctly this is all I need to do for all…
I'm a newbie to .htaccess and came across a a line that I think needs to be in the htaccess file. That lines reads "php_value session.auto_start 1." If I understand correctly this is all I need to do for all…
I am trying to map.htaccess to /books or /books/ or /books/<url_slug>: Options All -Indexes RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ $1 [R=301,L] # Map /books/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^books$ book.php [NC,L,QSA] Result: book.php:…
I'm no expert in Wordpress but have a fair amount of knowledge as I've used it for years. My problem is that I cannot access the admin panel for a specific site because it has been redirected to a different…
I just try to switch from php7.4 to php8.2 changing .httaccess like this: DirectoryIndex index.php AddHandler application/x-httpd-php82 .php <IfModule mod_negotiation.c> Options -MultiViews </IfModule> I am not succeeding. This is output of sudo update-alternatives --config php .htaccess is stored in same…
I occasionally make simple HTML websites with a handful of pages that later get passed along to developers that flesh them out with more sophisticated functionality. Is there an easy way — possibly with .htaccess — to throw the files…
i have two directories on a managed server system. One with a Drupal installation and another with a wordpress installation. /web/drupal/ /web/wordpress/ The domain pointed to the drupal installation with a htaccess in it. Now i want to specify special…
I would like to build many subdomains that ultimately download code from one directory. Examples: site1.domain.com, site2.domain.com, site3.domain.com should download the code from the site directory located inside the directory containing the website files, i.e. www/site. I use php, apache…
I'm on an apache2 installation and want to deny access to a specific php file with a .htaccess file <Files test.php> Require all denied </Files> Which does not work. However, denying access to a different file type does work as…
I have this code to create a new OrdID if no value for this variable exists: If ($OrdID=="") { $con = mysql_connect("localhost","xxx","xxx"); mysql_select_db("xxx_Order", $con); $query=mysql_query("Select Max(OrdID) FROM `Order`"); while($row=mysql_fetch_array($query)) { $OrdID= $row[0] + 1; } $sql = "INSERT INTO `xxx_Order`.`Order`…
I recently started working with the rewrite engine and asked for help on removing the PHP extension and adding a trailing slash to URLs. A perfectly working solution was provided by anubhava here. For a quick reference, the configuration file…