+ Reply to Thread
Results 1 to 6 of 6

Thread: Clean URL problem

  1. #1
    claes89 is offline x10Hosting Member claes89 is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    7

    Clean URL problem

    I have problems with configuring my new site here at x10hosting to use Clean URL's.
    I read the posts on the forum on this topic and none of the solutions worked for me.

    What I have tried to do is to add the following lines to my /home/xxx/public_html/.htaccess file

    Code:
     <FilesMatch "^article$">
    ForceType application/x-httpd-php
    </FilesMatch>
    Then I tried to load my file www.fysikmester.x10hosting.com/article.php as www.fysikmester.x10hosting.com/article

    (..Shortened by myself)

    I'm in dire need of help..
    Thank you


    SOLUTION:

    add/edit a file named .htaccess in the same folder as your intended "Clean URL page".
    Make it contain the following code (article example):

    Code:
     <FilesMatch "^article$">
    ForceType application/x-httpd-phpv1
    </FilesMatch>
    Then add a page called article (example) without any extention (ex. ".php").
    You can now access the article file as /article or /article/12345 or /article/anything you want. and the file article will be treated as an .php file (the beauty of it all).

    Thank you xPlozion for a great alternate.
    Last edited by claes89; 02-08-2009 at 06:26 PM.

  2. #2
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Clean URL problem

    Try using mod_rewrite. I don't think force_type works for that purpose.

    .htaccess
    Code:
    RewriteEngine On
    
    ^/article(/)?$ ./article.php
    Please note that there may be a few problems with the syntax since I'm my itouch...
    Last edited by xPlozion; 02-08-2009 at 09:41 AM.

  3. #3
    claes89 is offline x10Hosting Member claes89 is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    7

    Re: Clean URL problem

    That's wierd, becuase this article among others imply that the solution to clean URLs are ForceType
    http://www.evolt.org/article/Making_..._PHP/18/22880/

  4. #4
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Clean URL problem

    The way that works if I understood it correctly is that you need to make another php script to handle that information. Mod_rewrite does not need another seperate file to parse the urls.

    The rewrite method only requires you to modify the htaccess file and not make another file to handle urls.

  5. #5
    claes89 is offline x10Hosting Member claes89 is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    7

    Re: Clean URL problem

    I might have made myself unclear on what the purpose of using ForceType and FilesMatch was also on the link I provided.

    What I really want is to access the file xxx.xxx.com/article/ohm's-law
    and then as the link suggests use ForceType and FilesMatch to let article.php handle that link and then let the .php file use the link to determine what file to load (ohm's law).

    It's an alternate way of doing xxx.xxx.com/article?p=ohm's-law.

    I haven't tried out mod_rewrite yet - as I haven't read up on that yet. I am, however, convinced that using ForceType and FilesMatch for this matter is a viable solution. I just don't know why I can't get it to work on x10hosting.com

    I am very happy with your replies.

    I finally solved the question myself - watch my first post for an answer.
    Last edited by claes89; 02-08-2009 at 06:20 PM.

  6. #6
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Clean URL problem

    ok, glad to hear you solved it

+ Reply to Thread

Similar Threads

  1. Another Problem
    By beast474 in forum Free Hosting
    Replies: 1
    Last Post: 08-27-2008, 07:22 PM
  2. Slight Problem
    By rmb1993 in forum Free Hosting
    Replies: 2
    Last Post: 08-14-2008, 06:04 AM
  3. A problem with certificate
    By eon01 in forum Free Hosting
    Replies: 1
    Last Post: 07-31-2008, 01:27 PM
  4. DB number problem
    By lionheart8 in forum Free Hosting
    Replies: 5
    Last Post: 04-08-2008, 08:26 AM
  5. Problem uploading image (GD library problem)
    By HyDr@ in forum Free Hosting
    Replies: 1
    Last Post: 12-01-2006, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers