I am using hostgator web server to host my website. To use php 5.3 on my webserver I need to edit my .htaccess as
AddType application/x-httpd-php53 .php
I was just wondering if doing so will affect performance of webserver. Should I use there default version 5.2 or continue using 5.3 using rewrite.
Related
I have several webpages on my root directory (e.g. index.htm, home.php and home_page.php) which all are starting points for different versions of my website.
I ahve upgraded PHP version (as advised by my hosting service) from 5.3 to 5.6. This has put a .htaccess file on my site and now my PHP pages on root won't load and I get a "500 Internal Server Error" message.
The .htaccess file was created by the web hosting provider when the PHP version was updated.
The content of the .htaccess file is AddType application/x-httpd-php56 .php .php5.
If I delete the .htaccess file then my pages work OK as before but I do not know what the implications of deleteing this file are.
How do I log my exception errors?
Any help on how I can getall of my pages to be displayed, please?
hi everyone i have just created website to myself and i editted links using .htaccess (111.111.111.111/list.php | like 111.111.111.111/list ) not include php extension. but when i put files into my linux server, it doesn't work my linux nginx server. when i write 111.111.111.111/list on the url box, it display 404 not found page. it wants to me write 111.111.111.111/list.php
and everything is working on my computer localhost. (i didnt buy domain name i just use only server's ip) please help me
by the way i apologize for my english.
Nginx does not support .htaccess-files because of performance reasons.
https://www.nginx.com/resources/wiki/start/topics/examples/likeapache-htaccess/
You have to do this inside of the nginx configuration file.
To remove the .php maybe this helps:
How to remove both .php and .html extensions from url using NGINX?
If you really need .htaccess, you have to use apache instead of nginx.
I added .htaccess (for rewriting URLs) in my project's root directory but it's not working. I checked twice, the same file is working fine in Eclipse.
How do I configure PhpStorm to use .htaccess?
Indeed, PHP's built-in web server will never fully support .htaccess features. Note: it is PHP's, it is NOT PHPStorm's built-in server.
But there is a way around.
Most of the time, rewrites are needed only to redirect all the nonstatic file queries to index.php. If you only need this, you can set the server's "router script" in PHPStorm run configuration to index.php.
After that, a modest hack in index.php to serve static files from the drive may speed things up.
Add to the very beginning of index.php:
if (preg_match('/\.(?:php|png|jpg|jpeg|gif|ico|css|js)\??.*$/',
$_SERVER["REQUEST_URI"]))
{
return false; // serve the requested resource as-is.
}
Do you use the same server/configuration when working with PhpStorm and Eclipse?
As it was explained in the comments, it has nothing to do with the IDE, but with the web server (Apache) and its configuration.
You can edit .htaccess with any editor, if this virtualhost/directory configuration has AllowOverride All, ModRewrite is enabled and your rewrite rules are correct, it will work just fine.
You need to ensure that your PHP files are served from the correctly configured web server.
I recently moved my sub-domain hosted Joomla (sub.domain.com) to another host and my SEF URL's are broken. Currently I have Apache mod_rewrite turned off in the Joomla admin forcing the /index.php/ within all URL's
Apache mod_rewrite is loaded and working correctly. The major different in my hosting setup is that before my VPS host had a directory for the sub-domain within the server structure /home/me/sub.domain.com/ now it seems the new host is using another rewrite? as the server files is located in /var/www/domain.com whereas the front-end browser points to http://sub.domain.com
Not sure if there is a custom RewriteBase rule I'm not familiar with to correct this or perhaps there is another rewrite going on within the hosting which I'm not aware of?
Thanks for you time.
Have you made sure, that you DO NOT have set AllowOverride in your vhosts file to "none" ?
Is it possible to execute .htaccess file on Tomcat?
We are trying to get phphgadmin to work and so far we can only load the first screen that display some folder links. When we click on them we get a 404 error and we suspect it might be URL rewriting.
You can't run phpmyadmin on tomcat, because tomcat can't interpret php (nor it can interpret .htaccess)
What you need is Apache HTTP server, and if you need to also run Java, use mod_jk or mod_proxy_ajp (comparison) - a way to let apache serve what tomcat "produces".