PDA

View Full Version : Is it possible to change .php with .asp with htaccess


o0O0o.o0O0o
07-30-2009, 02:46 AM
My web extension is like abc.php.
is it possible that through htaccess or something else

i can change all the extension to .asp in URL

Jazz914
07-30-2009, 03:16 AM
Mod_rewrite :)

Also it can be ANYTHING in the world like .o0O0o xD

AddType application/x-httpd-php .php .xxx


Just change xxx bit to whatever you want it to be, good idea to keep it as a common extension like you stated (asp page) as having an extension like .hello sort of inihilates the disguise xD

o0O0o.o0O0o
07-30-2009, 04:45 AM
I wrote this thing in .htaccess

RewriteEngine on
AddType application/x-httpd-php .php .cfm

and put that file in home directory but still i see only php

Zangeel
07-30-2009, 04:48 AM
But the question is, is the file ACCESSIBLE from .cfm?

If you mod rewrite www.site.com/u.php?id=1 to www.site.com/1 both urls would be accessible.

Jazz914
07-30-2009, 10:27 PM
I wrote this thing in .htaccess

RewriteEngine on
AddType application/x-httpd-php .php .cfm

and put that file in home directory but still i see only php

Did you change the files to .cfm

you can't just mod_rewrite it and load them as .cfm
The code just tells the system to run .cfm files as .php

so instead of saving files as .php you would save them as .cfm
@Zangeel yes it will, if you are rendering .cfm file as php it makes no difference, just as long as when you are SEO'ing the link you have the above code before the rewriten urls.

instead of doing www.site.com/u.php?id=1
you would do www.site.com/u.cfm?id=1

o0O0o.o0O0o
07-31-2009, 12:11 AM
Now i undestand what does it mean . But i am using joomla so i can't just chnage the file extension. Have to search for some plugins if they do this sort of stuff

Jazz914
07-31-2009, 12:54 AM
if you whole site is made of php, it may just be better to leave it unless it is 100% absolutly needed?