|
Posted by Jon Slaughter on 05/03/07 10:05
"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:1178185075.511221.175380@y5g2000hsa.googlegroups.com...
> On May 3, 5:15 am, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com> wrote:
>> How the heck do I get mod rewrite to add extensions to any file?
>>
>> RewriteRule ^(.*)$ $1\.php [nc]
>>
>> To me that should find any group of characters(such as any path) and then
>> add the .php to the end? But this doesn't work and gives me a server
>> error.
>> If I remove the $ in front of the 1 then it does but ofcourse all my
>> links
>> end up as 1.php
>>
>> I can also do something like
>>
>> RewriteRule ^3(.*)$ $1\.php [nc]
>>
>> and all my links will be redirected to 3---.php
>>
>> What I want is to take
>>
>> [url] into [url].php
>>
>> (without query string and or other special chars such as ([^&?]&) or
>> [QSA])
>>
>> I just can't understand why the following does not work ;/
>>
>> RewriteRule ^(.*)$ $1\.php [nc]
>>
>> $1 should be whatever is matched by (.*)? (which should be the whole
>> url?)
>> In any case I can't see how its an error?
>>
>> Thanks,
>> Jon
>
> Why the n flag? That's what's causing the server error, I think.
>
no
means no case. wasn't working because of recursion I guess,
#RewriteCond %{REQUEST_URI} !\.php$
RewriteRule ^(.*)[/]$ /Index.php\?$1/Main.php
essentially works but need to par it down to only work in specific cases
Navigation:
[Reply to this message]
|