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

Thread: Static urls

  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Static urls

    I've used blogs: WordPress, b2evolution on Apache. These use permalinks/static urls. I guess they fetch urls from database and write rewrite rules into .htaccess files using PHP.
    My request from the experts here, is to show few examples to make urls static using .htaccess file.?Once, we've the key concepts, we can manipulte .htaccess file using PHP, to make our Web pages, SE friendly. This is exactly, the blogs, I've mentioned do.

    Apache documentation for mod_rewrite() is dry, and I'll be very glad, if you provide me few examples here.( I'll test myself )

    Please provide few nice urls for learning regular expressions and Apache mod_rewrite() module functions.

    Permalinks
    Special thanks.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You don't create links individually, what you do is create a pattern that mod_rewrite can match

    Code:
    RewriteEngine On
    RewriteRule ^blog/(.*)/(.*)/(.*)/ /index.php?postid=$1&something=$2&other=$3
    So if you typed in http://www.mydomain.com/blog/23/this...this_is_other/

    then it will look like http://www.mydomain.com/index.php?po...=this_is_other to the server


  •  

    Posting Permissions

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