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".
Related
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 have installed apache on centos and configured cpanel/whm.
I have a jsp project which is hosted on the server and also we need to maintain some php files for supporting helpdesk.
jsp project url is http:www.xyz.in:8090/jspproject/index.jsp
php files url is http:www.xyz.in/heldesk/index.html
helpdesk folder and jspproject are placed under public_html i.e. /home/account/publich_html.
The following task is required
When user types url either "http:www.xyz.in" or "http:www.xyz.in:8090" then jspproject should run (http:www.xyz.in/jspproject/index.jsp) and still url must be "http:www.xyz.in/jspproject"
When user types url as "http:www.xyz.in/helpdesk" then helpdesk (php files) should run (http:www.xyn.in/helpdesk/index.html) and url must be "http:www.xyn.in/helpdesk"
.htaccess is placed under /home/account/public_html/
Please advice me how to handle in .htaccess with rewrite rule.
I have an .htaccess file for page redirecting. It works fine in wampserver, but in phpstorm, it doesn't work and phpstorm doesn't use .htaccess.
For example, this works in wampserver:
localhost/Example/Page
This doesn't work in phpstorm:
localhost:63342/Example/Page
// 404 Not Found
Any thoughts on this problem?
.htaccess is used by the Apache webserver. It's not used by the PHPStorm web-browser though. If you want to be able to use it there, you would want to setup the 'Web path for project root' and point it to the appropriate location, as set in an Apache vhost.
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 am newbie for LAMP dev environment. is it possible to change the apache responses with a Linux shell script? Let's assume Browser request www.sam.com/styles/main.css and I want to serve www.sam.com/styles/main_new.css not main.css. I want to do this by using apache or Linux script. is this possible ? (sometimes this may be a silly question :D)
Thanks!
Asoka
You can learn something about url rewrite. And it is not possible to change the apache response by a linux shell.
You can use mod_rewrite.
Create a file named .htaccess in the site root directory with the follow content:
RewriteEngine on
RewriteRule /styles/main.css /styles/main_new.css