Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

htaccess url rewriting wrecking my head

  • 17-02-2015 10:19pm
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    I can't get my head around url rewriting.
    I've done regular expressions before but I still can't figure out what hell is going on.
    Anyway my addresses are in the form eg. on the about page
    /index?page=about
    and I'd like it to go to the same page if I type
    /about
    How do I go about doing that?


Comments

  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    RewriteRule ^([^/\.]+)/?$ /index.php?page=$1 [L]
    
    Found it in a site I was working on recently.

    It will sent /about to /index.php?page=about


  • Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭quinnd6


    It's great thanks I figured out what I was doing wrong with your solution.
    I just had to make a slight change to it and it worked for me.
    It was bringing me back to www so just added a ./ and it worked.
    RewriteRule ^([^/\.]+)/?$ ./index.php?page=$1 [L]

    Thanks a million for the help.


Advertisement