Forum Moderators: phranque
I have been piecing my .htaccess together for the last month and as would be expected from someone who only just heard of the rewrite mod a month ago, I am having my fair share of problems. Not the least of which being that while the set of RewriteRules I have written dont disrupt the page anymore they arn't actually rewritting anything either. So I've left them alone for now and moved to trying to have 'index' parsed as index.php. All my reading says this should work:
<Files index>
forcetype application/x-httpd-php
</Files>
so I added this between the <Files tags:
AcceptPathInfo Onmore 500's
more digging found this suggestion
<Files index>but again with the 500's
SetHandler application/x-httpd-php
</Files>
here is the relavent chunk of my .htaccess
RewriteEngine ON#the following are my failed attempts.
#<Files index>
#forcetype application/x-httpd-php
#AcceptPathInfo On
#</Files>#<Files index>
#SetHandler application/x-httpd-php
#</Files>Options +FollowSymLinks
Options +SymlinksIfOwnerMatchRewriteBase /site294/fst/var/www/html/bec/fleshmetal/
#~/index.php?main_page=index
RewriteRule ^main/([a-z]+)/$ /bec/fleshmetal/index?main_page=$1
If theres anything anyone can suggest....
please
<?php
print php_sapi_name() [php.net];
?>
Have you tried enabling php parsing on all php files?
AddHandler server-parsed .php
Jim
I've gotten so much further since you last helped thanks :)
The right order for the commands is something Ive been trying to nail down thanks for bringing it up. Looking at the chunk I posted what should I move where? and should I enable forcetype or SetHandler when trying AddHandler?
http://www.example.com/And if you put in something like this, does it work?
http://www.example.com/indexIf so, you need to modify your per-directory override (
.htaccess) file...
DirectoryIndex index
<Files index>
Forcetype application/x-httpd-php
</Files>
Let's start there. Take everything else out and try that first.
DirectoryIndex index
<Files index>
forcetype application/x-httpd-php
</Files>
if i manually cut .php out of the URL, index IS parsed as php :)!
also works with
AddHandler server-parsed .php
<Files index>
SetHandler application/x-httpd-php
</Files>
but as the sites script generates the URL with .php included i will always get the error below as soon as i clik a link
Not Found
The requested URL /dir/dir/index.php was not found on this server.
is there a rewrite rule to fix this? or should i listen to my housemate and start looking into alias's
Normally, yes. But in the first message ghostcorps has stated:
...and moved to trying to have 'index' parsed as index.php
My thought was that ghostcorps is trying to go extension-less. This would mean changing the extensions in the scripts to be just "index" without the
.phpextension. Unless I'm missing something?
No luck though, the script is still calling for index.php. I think Ill give up for now. And get back to gettng the rewrite rules working.... while im here can you please help with my Rewritebase? I'm using the physical path at the moment
/site294/fst/var/www/html/dir/subdir/where the index.php and .htaccess are in subdir, Or should i use the path that shows in ftp
/home/cris/mainwebsite_html/dir/subdir/
Thing is I dont even know if my base isnt working, al I knwo is the ruls arn't.. is there a set of guidelines for writting the Base anywhere?