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

subdomain htaccess rediect with query string

Yeah, its possible. Add the following to your htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ^((?!www\.).+)\.example.com RewriteRule !index\.php http://%{HTTP_HOST}/user/index.php?name=%1 [L,R,NE] The rule above will redirect foo.example.com to foo.example.com/user/index.php?name=foo

URL Redirect / URL Masking [closed]

Try creating .htaccess and putting the following in it: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^ICEEC$ viewjc.php?id=c5 [L] RewriteRule ^ICEEC/$ viewjc.php?id=c5 [L] </IfModule> Make sure that the viewjc.php is at the same directory as your .htaccess If you’re just trying to change URL address bar when someone visits particular page of your website, add this to … 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