How to Change Dynamic URLs
Dynamic URLs are a way to create user-friendly links that are seen by search engines. For instance, if you have a link named "domain.com/?=33" that points to your widget product, you can change that link to be more friendly and display domain.com/my-widgets.php. This process is accomplished by using the .htaccess file in the root of your host domain.
Instructions
-
-
1
Ensure that your host provider gives write access to the .htaccess file. An easy way to find this out is to use the phpinfo() function. Create a new php file and run the following code on the host server:
<?php
phpinfo();
?>
This lists the php capabilities for Apache. If "mod_rewrite" is listed, then you can create dynamic URLs on the fly. -
2
Create a form where subjects are entered. Dynamic URLs are used by content provider websites. The name of the URL is normally the subject. In the following code, a subject string is created that is used to create the URL:
$subject = "My Dynamic URL"; -
-
3
Edit the .htaccess file. This file is in plain text and is used in the root folder of the website to configure the dynamics of the pages. The following code uses the subject string from Step 2 to create the name of the file. This edit will create dynamic URLs for all web pages created with a subject.
Options
+FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule type(.*).htm$ /main.php?subject=$2 -
4
Upload the edited .htaccess file. Once edited, the file needs to be uploaded to the root of your website host directory.
-
1