Reply
apache: /page/ instead of page.php (mod_rewrite?)
Old 08-06-2009, 01:20 PM apache: /page/ instead of page.php (mod_rewrite?)
Junior Talker

Posts: 2
Trades: 0
Hi,
I want to set up apache in a way, that instead of displaying pages (signup.php, register.php, something_else.php), it displays (/signup/, /register/) etc.. in the address bar. I'm not familiar with mod_rewrite, but as far as I understood, that's what I'll need. Can you please point me in the right direction? Thanks!
rotten_yellow is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-06-2009, 02:02 PM Re: apache: /page/ instead of page.php (mod_rewrite?)
freeloader's Avatar
Experienced Talker

Posts: 35
Trades: 0
Code:
# seamlessly rewrite /something/ to /something.php
RewriteRule ^(.*)/ $1.php
Above is untested and crafted without knowledge, but a handy reference. If you request /signup/, it replies with the code of /signup.php etc.

You put that in your .htaccess file.

HTH,
__________________
"It is a profitable thing, if one is wise, to seem foolish." --Aeschylus
cheap unlimited web hosting | free domain site list
free unlimited online backup
freeloader is offline
Reply With Quote
View Public Profile
 
Old 08-06-2009, 09:31 PM Re: apache: /page/ instead of page.php (mod_rewrite?)
Junior Talker

Posts: 2
Trades: 0
Thanks for that! It didn't work out in my case. The problem is, somebody gave me a site, what I need to update. The site's "include" files are in different directory, outside of document root, whenever I click on a link, I get 404, so I think the apache for the person was setup in a different way, because all the links point to '/something/', but the actual files are in '../different_dir/pages/something.php', so I'm not sure how to set this up, any guidance please? Thanks
rotten_yellow is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to apache: /page/ instead of page.php (mod_rewrite?)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.14805 seconds with 13 queries