URL rewriting with PHP

You can essentially do this 2 ways: The .htaccess route with mod_rewrite Add a file called .htaccess in your root folder, and add something like this: RewriteEngine on RewriteRule ^/?Some-text-goes-here/([0-9]+)$ /picture.php?id=$1 This will tell Apache to enable mod_rewrite for this folder, and if it gets asked a URL matching the regular expression it rewrites it … Read more

URL rewrite with .htaccess for wildcard domain

Try putting some rewrite rules like this in your .htaccess file: RewriteEngine on RewriteBase / # Make sure it’s not an actual file or # directory, being accessed. If you wish. #RewriteCond %{REQUEST_FILENAME} !-f #RewriteCond %{REQUEST_FILENAME} !-d # Match the subdomain RewriteCond %{HTTP_HOST} !^www\.example\.com$ RewriteCond %{HTTP_HOST} ^(.*)\.example\.com$ # Rewrite the request to the main domain: … Read more