Results 1 to 3 of 3

Thread: Mod Rewrite - Apache

  1. #1
    Registered ZigE's Avatar
    Join Date
    Dec 2006
    Posts
    122

    Mod Rewrite - Apache

    I'm not the best at mod write, but I have 100+ options, and want to output it like this

    domain.com/mister-mod-for-sale/
    domain.com/misses-wotts-for-sale/
    domain.com/doctor-for-sale/
    etc etc..


    Now should I be inputing "mister-mod" into my database, as is,

    ..or is that kinda *** backwards, as in I could just put in "Mister Mod" , and derive someway for apache to recognize & rewrite the variable?


    Currently I've been using a number as the variable, but I want my url's as clean as possible, without having to write them all out by hand, on one of my new sites
    Last edited by ZigE; 11-18-2007 at 05:03 AM.

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Yes,

    IF you want to use textual identifiers for your pages the easiest way is to put a textual indentifier in your database for each page. After that it is fairly straightforward if you follow the SE friendly URLs article on this site.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Registered
    Join Date
    Mar 2006
    Posts
    156
    Like Chris said, instead of using a numeric id to identify each page, you can use a text id and use mod_rewrite to make it search engine friendly.

    So, if you have a table with this fields: id | page_name | content
    You can now add a new text field: id | sef_id | page_name | content

    The "sef_id" column will be your text id. Something like "mister-mod-for-sale".

    Then your links will look like "domain.com/mister-mod-for-sale/" and you can use mod_rewrite and tell it to show any pages with that text id.

Similar Threads

  1. Configuring Apache for local machine only, need to close port 80
    By deronsizemore in forum Web Hosting & Servers
    Replies: 8
    Last Post: 10-20-2014, 04:41 PM
  2. IIS and Apache open to the outside on one machine
    By bwall in forum Web Hosting & Servers
    Replies: 0
    Last Post: 11-19-2005, 02:37 PM
  3. Mod Rewrite
    By Masetek in forum Website Programming & Databases
    Replies: 2
    Last Post: 10-07-2005, 06:02 PM
  4. Mod Rewrite, to Remove Spaces
    By Emancipator in forum Website Programming & Databases
    Replies: 2
    Last Post: 11-06-2004, 05:02 PM
  5. IIS vs. Apache
    By moonshield in forum Web Hosting & Servers
    Replies: 15
    Last Post: 10-13-2004, 01:26 PM

Bookmarks

Posting Permissions

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