Clean URL problem

claes89

New Member
Messages
7
Reaction score
0
Points
0
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:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
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:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
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.
 

claes89

New Member
Messages
7
Reaction score
0
Points
0
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:
Top