Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer htaccess url rewrite

    Hi,

    I am trying to create good looking urls for my website. But after reading several tutorials it still does not work the way I do it.

    I'd like to change www.mywebsite.com/?p=home
    to be seen by surfers as www.mywebsite.com/home
    but still it needs to be rewritten to the first, in order to make the site work off course.

    I also tried with reg.ex. but this makes the site not show the css since this is rewritten as well....

    There are only little few pages where I'd like to do this. So I guess using a reg.ex. is required. I can just set them manually by hand.

    Could anyone please give me some feedback or tips on this subject?

    Thanks!

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    iirc...

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^[-_a-zA-Z0-9]/?$ index.php?p=$1
    Alternatively, if you have a set number of options, you can be more explicit, if you want...

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^([home|about|section3|section4])/?$ index.php?p=$1


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •