Htaccess DESPERATE HELP!

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
ebolotin
Forum Newbie
Posts: 3
Joined: Wed Feb 07, 2007 2:41 am

Htaccess DESPERATE HELP!

Post 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!
konstandinos
Forum Commoner
Posts: 68
Joined: Wed Oct 04, 2006 4:20 am

Post 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/
ebolotin
Forum Newbie
Posts: 3
Joined: Wed Feb 07, 2007 2:41 am

Post 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...
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

You need to use mod_rewrite. How good are your regular expressions?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

.htaccess != PHP.

Moved to Installation.
ebolotin
Forum Newbie
Posts: 3
Joined: Wed Feb 07, 2007 2:41 am

Post by ebolotin »

my expressions are nonexistent... thats why i need help writing the mod_rewrite code for this particular task.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

I'm not too hot on mod_rewrite myself. Try http://forum.modrewrite.com/
Post Reply