Page 1 of 1

Htaccess DESPERATE HELP!

Posted: Wed Feb 07, 2007 2:44 am
by ebolotin
Hi. I am trying to do the following:

My site navigation URLS are all as such:
http://site.com/beta/artwork/
http://site.com/beta/home/

all of these pages are actually php files.

so, /artwork/ is actually artwork.php and /home/ is actually home.php.

What is the .htaccess code that I need for this conversion to work, so when the user goes to http://site.com/beta/artwork/, the server knows to access http://site.com/beta/artwork.php.

Thanks!

Posted: Wed Feb 07, 2007 2:59 am
by konstandinos
hi

if you rename home.php to index.php, and artwork.php to index.php as well, then when you access mysite/beta/artwork/, the browser will automatically know to open index.php, and the same for /home/

Posted: Wed Feb 07, 2007 3:16 am
by ebolotin
yes but the problem is that when i click on the link pertaining to "http://site.com/beta/artwork/", the browser ATTEMPTS to access /artwork/ but realizes that the page doesn't exist (because it has no extension)... 404. And if i were to rename those pages to index.php then when the my index.php attempts to include the artwork page it will have no reference to find it... the way the site works is that when a user clicks on a page, the URI changes to the new link and the index page uses this indicator (the /artwork/ part of the URL) to access the database and find the relevant page link (artwork.php)... I specifically need the .htaccess code that makes the server realize that /artwork/ is actually /artwork.php...

Posted: Wed Feb 07, 2007 3:33 am
by Ollie Saunders
You need to use mod_rewrite. How good are your regular expressions?

Posted: Wed Feb 07, 2007 1:26 pm
by feyd
.htaccess != PHP.

Moved to Installation.

Posted: Wed Feb 07, 2007 3:01 pm
by ebolotin
my expressions are nonexistent... thats why i need help writing the mod_rewrite code for this particular task.

Posted: Wed Feb 07, 2007 7:18 pm
by Ollie Saunders
I'm not too hot on mod_rewrite myself. Try http://forum.modrewrite.com/