Ubuntu Apache pseudo-static configuration url rewriting steps: 1. load the rewrite module sudoln-s/etc/apache2/mod-available/rewrite. load/etc/apache2/mod-enabled/rewrite. load2. change AllowOverrideNone in & lt; Directory & gt; & lt;/Directory & gt; of your host
To rewrite the url of Ubuntu Apache pseudo-static configuration, follow these steps:
1. Load the rewrite Module
Sudo ln-s/etc/apache2/mod-available/rewrite. load/etc/apache2/mod-enabled/rewrite. load
2. Change AllowOverride None in to AllowOverride All
3. Create a. htaccess file under the directory of your website
Create the following content:
RewriteEngine on
RewriteBase/
RewriteRule ^ (. *) show-([0-9] +)-([0-9] +) \. html $1/show. php? Itemid = $2 & page = $3
In this example, the rewriteruleis intended to input show-1-2.html in the browser, but the actual access is show. php? Itemid = 1 & page = 2
4. Restart apache2
5. Test
Input in show. php
Echo $ _ GET ['itemid']. $ _ GET ['page'];
?>
You will see
Get Results