Results 1 to 7 of 7

Thread: SE Friendly URLS

  1. #1
    Junior Registered My220x's Avatar
    Join Date
    Jan 2009
    Location
    UK
    Posts
    3

    SE Friendly URLS

    I am using the ForceType method outlined on this site however I can't get it to work, I just get directory not found, can anyone help? Im running xampp for linux.

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Did you do the test?

    Open up a regular php file and see if you can access REQUEST_URI.

    Also, is this your server or a shared host? It is possible your host turned off this apache feature.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Junior Registered My220x's Avatar
    Join Date
    Jan 2009
    Location
    UK
    Posts
    3
    I put the following:

    PHP Code:
    <?php

    echo $_SERVER["REQUEST_URI"];

    ?>
    in a php file and I got the URI.

  4. #4
    Registered deathshadow's Avatar
    Join Date
    Apr 2008
    Posts
    41
    I really dislike force-type - just because dicking with the mime-type is just making things more complicated to me.

    I use mod-rewrite, but I use a different appraoch than the one outlined on this site...

    Code:
    RewriteEngine On
    
    RewriteRule !\.(gif|jpg|png|css|swf|html|js|ico|xml)$ index.php
    Basically the above tells the server to reroute all requests EXCEPT files with those extensions to my index.php, from which I handle all operations. You then just explode REQUEST_URI since that does NOT change on a mod-rewrite.

    You'll also see I do NOT allow php file requests to be made, redirecting those to index.php - this is a primative security feature of sorts since it prevents apache from allowing users to call any of your libraries independantly.

  5. #5
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Quote Originally Posted by deathshadow View Post
    I really dislike force-type - just because dicking with the mime-type is just making things more complicated to me.

    I use mod-rewrite, but I use a different appraoch than the one outlined on this site...

    Code:
    RewriteEngine On
    
    RewriteRule !\.(gif|jpg|png|css|swf|html|js|ico|xml)$ index.php
    Basically the above tells the server to reroute all requests EXCEPT files with those extensions to my index.php, from which I handle all operations. You then just explode REQUEST_URI since that does NOT change on a mod-rewrite.

    You'll also see I do NOT allow php file requests to be made, redirecting those to index.php - this is a primative security feature of sorts since it prevents apache from allowing users to call any of your libraries independantly.
    That is a pretty good idea for the security aspect.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  6. #6
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Quote Originally Posted by My220x View Post
    I put the following:

    PHP Code:
    <?php

    echo $_SERVER["REQUEST_URI"];

    ?>
    in a php file and I got the URI.
    So then what is the problem?
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  7. #7
    4x4
    Join Date
    Oct 2004
    Posts
    1,043
    I do the same as mentioned previously... except I do it like this. Which I believe is how WordPress "SEO Friendly URLS" works too.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Not only does it let me pass it all to my index file I can change up my URL structure on the fly as I have an option to set new structure too.

Similar Threads

  1. SE Friendly URLs - Custom Error Pages
    By Mike in forum Website Programming & Databases
    Replies: 8
    Last Post: 04-03-2006, 06:13 PM
  2. SE Friendly URLS...This should work shouldn't it?
    By Mike in forum Website Programming & Databases
    Replies: 1
    Last Post: 03-25-2004, 09:28 AM
  3. Search Engine friendly urls ?
    By Dan in forum Search Engine Optimization
    Replies: 6
    Last Post: 02-11-2004, 06:26 PM
  4. Multiple SE Friendly URLS
    By incka in forum Website Programming & Databases
    Replies: 6
    Last Post: 02-07-2004, 08:44 AM
  5. Search Engine Friendly URLS
    By dolphin in forum Search Engine Optimization
    Replies: 8
    Last Post: 12-01-2003, 09:01 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
  •