0

Im trying to rewrite my url currently www.example.com/storepage.php?name={ANYNUMBER}

I want to make the URL look like this, www.example.com/store/{ANY NUMBER}

I have created a .htaccessfile and have come up with this code, is it written wrong for what i want to achieve ?

Options +FollowSymlinks

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^storepage/([0-999]+)/?$    storepage.php?name=$1    

Any help greatly appreciated

Bradley
  • 129
  • 8
  • Could you tell us more about the error you are facing, *"wrong for what i want to achieve"*? – Manikiran Aug 19 '16 at 01:40
  • @Manikiran Strangely enough it does nothing, the URL is unchanged, – Bradley Aug 19 '16 at 01:47
  • What url are you entering? as the code you have will not cause a redirect from `www.example.com/storepage.php?name={ANYNUMBER}` to `www.example.com/store/{ANY NUMBER}` it will only cause if you enter `www.example.com/store/{ANY NUMBER}` to work like you actually visited `www.example.com/storepage.php?name={ANYNUMBER}` – davidejones Aug 19 '16 at 01:48
  • it does not change your url's you have to do that. –  Aug 19 '16 at 01:49
  • Here is my URL : ukvoucherhub.co.uk – Bradley Aug 19 '16 at 01:50
  • if you have any suggestions to what to change in the .htaccess i can upload through FTP and you can view them live, if you done mind helping – Bradley Aug 19 '16 at 01:51
  • @DavidJones Yes i would just like the URL to look more presentable, – Bradley Aug 19 '16 at 01:53
  • maybe something like this `Options +FollowSymlinks RewriteEngine On RewriteRule ^storepage.php?name=(.*)$ /storepage/$1/ [R=301,L] RewriteRule ^storepage/([0-9]+)/?$ /storepage.php?name=$1 [NC,L] ` – davidejones Aug 19 '16 at 02:01
  • @DavidJones Strangely enough the URL is unchanged and shows in browser as it did before – Bradley Aug 19 '16 at 02:11
  • Franky i find "pretty links" a waist of time –  Aug 19 '16 at 02:30

0 Answers0