Home >Backend Development >PHP Tutorial >A question about Apache Rewrite switching from FPM to FastCGI
The purpose is to display the Url
like http://test.com/front/index on the PC version as http://test.com/m/front/index on the mobile version
The actual link should be http: //test.com/front/index?mode=m
Now I write Rewrite in the test environment like this:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^m/?(.*)/?$ index.php/$1/?mode=m [QSA,PT,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
Everything can be accessed normally , and there was a problem on the server
The local test environment is XAMPP (according to others, it is FPM), and the server is Apache FastCGI
I would like to ask how to rewrite the Rewrite rules to enable normal parsing, thank you?
The purpose is to display the Url
like http://test.com/front/index on the PC version as http://test.com/m/front/index on the mobile version
The actual link should be http: //test.com/front/index?mode=m
Now I write Rewrite in the test environment like this:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^m/?(.*)/?$ index.php/$1/?mode=m [QSA,PT,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
Everything can be accessed normally , and there was a problem on the server
The local test environment is XAMPP (according to others, it is FPM), and the server is Apache FastCGI
I would like to ask how to rewrite the Rewrite rules so that it can be parsed normally, thank you?