Forum Moderators: phranque

Message Too Old, No Replies

Help with htaccess problem

         

djwmguk

2:16 pm on Feb 15, 2011 (gmt 0)

10+ Year Member


Hey all,

I've got a problem, an old hosting company managed to delete an htaccess file for a site, however we dont apppear to have a backup.

Basically you access the site, na dwhen you click on a link such as about us it forwards to domain.com/about

The issue is that isnt a real folder, the whole site seems driven by index.php

If I access the site domain.com/index.php/about it works...

How would i rewrite this on the htaccess file?

Thanks

Samizdata

12:52 am on Feb 16, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



we dont appear to have a backup

Actually you might - because the filename starts with a dot/period it will usually be "invisible" on your local computer. The first thing to try is to show hidden and system files, you might be lucky.

If not, there are lots of code examples in this forum, but if you are new to .htaccess you need to understand that it is extremely powerful and that one character out of place can take your entire site offline.

Beginners need to proceed with extreme caution.

Welcome to WebmasterWorld.

...

jdMorgan

1:09 am on Feb 18, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As described, the site appears to use extensionless URLs and AcceptPathInfo. Therefore, something likes this will solve the problem exactly as described above.

Options +FollowSymLinks -MultiViews
RewriteEngine on
#
# Internally rewrite all extensionless URLs not ending in "/" to index.php
RewriteCond $1 !^index\.php(/.*)?$
RewriteRule ^(([^/]+/)*[^./]+)$ index.php/$1 [L]

Always make a backup of everything... every day.

Jim