mod-rewrite

mod_rewrite proxy timeout

混江龙づ霸主 提交于 2021-02-20 11:21:28
问题 I have apache setup to proxy requests to backend app servers. There are several backend servers and there is a big rewrite_rules file which is processed for each request to properly proxy all the requests to app servers. One particular app server sometimes takes a long time to respond back, causing the proxy server to become slow if a lot of requests are being proxied to that particular server, as the requests are waiting to get the response back and eventually timeout after the timeout

stop .htaccess mod_rewrite in a directory

守給你的承諾、 提交于 2021-02-18 21:57:37
问题 I have copied some code (for Wordpress permalinks) into my .htaccess file in the root directory. All has been working fine. This is the code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> I've now created a new directory that I want to password protect using .htaccess. I've set that up (using a ht.access file in the directory I want to

Apache 2.4 + FPM + Wordpress Multisite: URL Rewrite not working in admin

那年仲夏 提交于 2021-02-18 19:19:52
问题 I just moved a Wordpress multi-site from a Apache 2.4 Prefork + mod_php to a new server with Apache 2.4 Event + php-fpm. The site is working well on the frontend and it is a lot faster then before due to the CGI, but... the Wordpress administration panel is working just for the main site (and network administration). The admin area for the second site is no more working, but the frontend is working great. Examples http://www.example.com/en/wp-admin/ => works http://www.example.com/en/wp-admin

apache mod_rewrite is not working or not enabled

廉价感情. 提交于 2021-02-17 14:30:48
问题 I have installed rewrite_module and modified php.ini on Apache. I create rewrite.php and .htaccess files, but it's not working. My filesystem folders like: /var/www/html /var/www/html/test /var/www/html/test/.htaccess /var/www/html/test/rewrite.php /var/www/html/.htaccess content is: $ cat /var/www/html/test/.htaccess RewriteEngine On RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L] /var/www/html/rewrite.php $ cat /var/www/html/test/rewrite.php <html> <h2 align=center> <?php // mod

apache mod_rewrite is not working or not enabled

陌路散爱 提交于 2021-02-17 14:30:13
问题 I have installed rewrite_module and modified php.ini on Apache. I create rewrite.php and .htaccess files, but it's not working. My filesystem folders like: /var/www/html /var/www/html/test /var/www/html/test/.htaccess /var/www/html/test/rewrite.php /var/www/html/.htaccess content is: $ cat /var/www/html/test/.htaccess RewriteEngine On RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L] /var/www/html/rewrite.php $ cat /var/www/html/test/rewrite.php <html> <h2 align=center> <?php // mod

Remove folder name from URL

安稳与你 提交于 2021-02-11 18:02:17
问题 I have a domain www.domain.com redirected to / in my server. Next I have index.php whith code: header("Location: http://domain.com/v3/"); When I enter mydomain.com I have mydomain.com/v3/ in url. How to remove v3 from Url 回答1: Remove header line from your PHP code since it is doing a redirect and have this lookahead based rule in your root .htaccess : RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+v3/([^?\s]*) [NC] RewriteRule ^ /%1 [R=302,L,NE] RewriteRule ^((?!v3/).*)$ /v3/$1 [L

.htaccess mod_rewrite for web service as well as hide other files

怎甘沉沦 提交于 2021-02-11 16:11:55
问题 I think I know how to hide the files but how do I use mod_rewrite to allow only the web service to be called in the same directory? Here is the directory/file structure /var/www/html/xmlrpc/xmlrpc.server.php /var/www/html/xmlrpc/xmlrpc.client.php /var/www/html/xmlrpc/xmlrpc.class.php /var/www/html/xmlrpc/xmlrpc.ini /var/www/html/xmlrpc/logs Important note: /var/www/html/xmlrpc/logs has 777 permission before you start harping on me I plan to move this into a non public directory and give the

.htaccess mod_rewrite for web service as well as hide other files

筅森魡賤 提交于 2021-02-11 16:06:24
问题 I think I know how to hide the files but how do I use mod_rewrite to allow only the web service to be called in the same directory? Here is the directory/file structure /var/www/html/xmlrpc/xmlrpc.server.php /var/www/html/xmlrpc/xmlrpc.client.php /var/www/html/xmlrpc/xmlrpc.class.php /var/www/html/xmlrpc/xmlrpc.ini /var/www/html/xmlrpc/logs Important note: /var/www/html/xmlrpc/logs has 777 permission before you start harping on me I plan to move this into a non public directory and give the

.htaccess mod_rewrite for web service as well as hide other files

Deadly 提交于 2021-02-11 16:04:34
问题 I think I know how to hide the files but how do I use mod_rewrite to allow only the web service to be called in the same directory? Here is the directory/file structure /var/www/html/xmlrpc/xmlrpc.server.php /var/www/html/xmlrpc/xmlrpc.client.php /var/www/html/xmlrpc/xmlrpc.class.php /var/www/html/xmlrpc/xmlrpc.ini /var/www/html/xmlrpc/logs Important note: /var/www/html/xmlrpc/logs has 777 permission before you start harping on me I plan to move this into a non public directory and give the

htaccess redirecting specific URL to new domain

怎甘沉沦 提交于 2021-02-11 15:30:49
问题 I'm getting myself seriously confused with Rewrite Conditions and Rewrite Rules in my htaccess file. Basically I have a new domain and want to redirect my articles to the new domain. For instance in someone visits old-domain.com/article/XYZ-article-title I want it to redirect to new-domain.com/article/XYZ-article-title. Where I'm getting myself confused is that I only want it to redirect if /article is in the domain (the old domain is still in use for other stuff). 回答1: You can use this code