April 21, 201214 yr Hello, I am currently coding a new website and am up to the part of clearing little bits up etc purely for better useability (if thats even a word) anyhow, ive tried a range of things on .htaccess and cant manage to get it to work (i suck at htaccess) this is basically what im trying to achieve, my url for someone to be linked to an offer for example is www.example.com/index.php?page=offer53 I want it so that i can add a new line in htaccess so the user can simply type www.example.com/offer53 and it automatically redirects them to www.example.com/index.php?page=offer53 could anyone help, im on apache Cheers, Gary
April 21, 201214 yr Try this... Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^([a-z0-9]+)*$ index.php?page=$1 [NC] I think that should work, it should also work for anything such as offer54 and will take the user to ?page=offer54
April 21, 201214 yr Author Try this... Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^([a-z0-9]+)*$ index.php?page=$1 [NC] I think that should work, it should also work for anything such as offer54 and will take the user to ?page=offer54 that done the trick, thankyou +1
Create an account or sign in to comment