Page 1 of 1

htaccess urlrewriting problem

Posted: Sun Jun 06, 2010 2:58 pm
by me666
hi all,
i have a html file i have upgraded to php for use with more functions, but i have php include connecting to the file in around 30-40 files. with this i have written in my .htaccess file the following 3 lines

Code: Select all

RewriteEngine On
RewriteRule ^include/oldfile\.html$ /include/newfile.php 
RewriteRule ^include/oldfile\.html/$ /include/newfile.php
but it still only includes the old html file rather than the new file. is there anything i have done wrong here or another piece of code i could use once? or will i just have to manually edit all my include calls to .php rather than .html?
thanks :)

Re: htaccess urlrewriting problem

Posted: Sun Jun 06, 2010 3:04 pm
by markusn00b
Calls to include() do not make a request to the server - that is why no redirect occurs. You could sym-link it, or you could just not be lazy and include the correct file.

Further more, you're include()ing HTML into PHP?

Re: htaccess urlrewriting problem

Posted: Sun Jun 06, 2010 3:17 pm
by me666
ok thanks for the reply, i'll just change them manually :)

yes html into php as in the html file i have only my <body> tag so that i can easily change the colours of my whole site by changing that single file, i have created a php colour theme changer though and need the file to be php.

i will go through and change them all, thanks anyway