URL Rewrite is a feature that rewrites web addresses. It is often used to convert dynamic URLs into user-friendly URLs that appear static, a process known as making a URL pseudo-static. This topic provides a test sample for URL Rewrite that uses Chinese characters and describes how to configure pseudo-static URLs for a basic Linux-based Cloud Web Hosting instance.
Prerequisites
The FileZilla client is installed. To download the client, click FileZilla.
The website program files are available on your local host.
You can download the pseudo-static Chinese URL Rewrite test sample.
Background information
The method in this topic applies only to basic Linux-based Cloud Web Hosting instances, which use Apache as the web server.
Enhanced Edition Cloud Web Hosting instances do not support the pseudo-static feature using .htaccess files. You can edit pseudo-static rules by configuring an Nginx file. For more information, see Configure an Nginx file (for Enhanced Edition Cloud Web Hosting instances).
Procedure
Connect to the Linux-based Cloud Web Hosting instance using FileZilla.
For more information, see Manage website program files using FileZilla.
Check the /htdocs folder of the Linux-based Cloud Web Hosting instance to determine if the pseudo-static rule file .htaccess exists.
The .htaccess file is a hidden file. For information about how to show hidden files, see How do I show hidden files in FTP?.
Execute the following operations based on the query results from the pseudo-static rule file .htaccess:
If the .htaccess file exists: Download the .htaccess file to your local host as a backup. Then, delete the .htaccess file from the site's root directory and proceed to Step 3.
If the .htaccess file does not exist: Proceed to Step 3.
Use FileZilla to upload the htaccess and test.php files from the URL Rewrite sample package to the /htdocs folder of the Linux-based Cloud Web Hosting instance. Then, rename the htaccess file to .htaccess.
Verify that you can access the website page.
Normal access (without the pseudo-static feature): In the address bar of your browser, enter http://your domain name/test.php?action=China&id=1 and press Enter.
The access result is as follows:
action=China id=1Forwarded access (with the pseudo-static feature): In the address bar of your browser, enter http://your domain name/China-1.html and press Enter.
The access result is as follows:
action=China id=1If the forwarded access result matches the normal access result, the forwarding is successful. This indicates that the pseudo-static feature is enabled for the Cloud Web Hosting instance. If the results are different, the forwarding failed. In this case, check that the URL parameter format in the browser's address bar is correct.
For more information about configuring forwarding rules, see URL Rewriting Guide.