Closed Thread Icon

Topic awaiting preservation: .htaccess (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=27478" title="Pages that link to Topic awaiting preservation: .htaccess (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: .htaccess <span class="small">(Page 1 of 1)</span>\

 
justin
Obsessive-Compulsive (I) Inmate

From: Stockholm, Sweden
Insane since: Jan 2006

posted posted 02-12-2006 19:54

Hi

I'm trying to use a .htaccess to make it possible to use inline php in .html files and parse files with my own extension .yo as php, but it's not working.

What I'm using is this:
AddType application/x-httpd-php .php .html .yo

I have also tried with this:
AddHandler application/x-httpd-php .php .html .yo

and with this:
AddType x-httpd-php .php .html .yo

But nothing is working. When I use AddHandler the server doesn't even recognise the default .php files.
I know .htaccess DOES work since I've got my 404's and password linked with it, but I'm starting to believe that the server-host have disabled some of the commands. Yupp, it's a shared-server so I cannot edit the httpd.conf

Also, while I'm at it, and believing it's a somewhat similar matter, I'm interested in knowing how to "hide" the files and only make it look like a directory instead.
For instance. I have a list of users. Instead of listing them as:
http://url/users.php?id=123
I would like it to look like this:
http://url/123
Is this possible?

Regards,
Justin

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-12-2006 21:14

You might want to look here What are search engine friendly URLs? to get started on the URL thing.


:edit: Just learning how to use the FAQ graphic thingy. :/edit:
- Butcher -

(Edited by butcher on 02-12-2006 21:23)

divinechaos
Nervous Wreck (II) Inmate

From:
Insane since: Dec 2001

posted posted 02-12-2006 21:15

First, I would suggest avoiding adding types already installed (.php), and just install the new types.

code:
AddType application/x-httpd-php .html .yo
AddHandler x-httpd-php .html .yo



As for your second question, that is the domain of the "mod_rewrite" Apache module. Check out the Apache documentation and other resources like http://www.modrewrite.com. You'll be able to translate the former into the latter without any mention to the user

Regards,
DC

justin
Nervous Wreck (II) Inmate

From: Stockholm, Sweden
Insane since: Jan 2006

posted posted 02-13-2006 23:20

Thanks a million guys!

Turns out the host hade turned off all the AddType commands so I'm still left with the unromantic php-extensions. No biggie really.
The mod_rewrite however runs like a perl, that is after I realised that the linked files wouldn't work without the quit obvious "/". Thanks a million guys!

« BackwardsOnwards »

Show Forum Drop Down Menu