Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
| Search | Today's Posts | Mark Forums Read
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 5th, 2005, 04:58 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default Apache mod_rewrite()

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.

Quote:
quote:Permalink
Special thanks.

__________________
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
PHP, SEO | anshul shrivastava | mediasworks.org | FB
  #2 (permalink)  
Old October 13th, 2005, 06:19 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Here's the .htaccess file from ruby on rails, should get you started.
http://dev.rubyonrails.com/file/tool...blic/.htaccess

The O'Reilly 'Mastering regular expressions' book is highly recommended - take a look at the sample chapter:
http://www.oreilly.com/catalog/regex/chapter/ch04.html

HTH Charlie

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
  #3 (permalink)  
Old October 14th, 2005, 09:09 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I posted an article on my own experiences with this not too long ago:
http://p2p.wrox.com/topic.asp?TOPIC_ID=31036

Basically what I did was bypass normal 404 error handling, so that when a request comes in for a document that doesn't exist, I forward that to a PHP script where I dissect the URL and serve the appropriate content. It's pretty much the same as creating your own database-driven file system.

Let me know if you have any questions.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design


Similar Threads
Thread Thread Starter Forum Replies Last Post
mod_rewrite stevenpup ASP.NET 2.0 Basics 2 December 22nd, 2007 05:54 PM
mod_rewrite question harpua Pro PHP 0 April 12th, 2007 08:56 PM
Mod_rewrite heerajee Pro PHP 1 March 8th, 2006 06:35 AM
mod_jk + apache + mod_rewrite fanch Apache Tomcat 0 December 5th, 2005 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.