phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Redirecting using Mod rewrite

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
nims
phpBB SEO Team
phpBB SEO Team


Joined: 11 Oct 2006
Posts: 243
Location: New Delhi, India

Redirecting using Mod rewritePosted: Tue Dec 19, 2006 1:10 pm    Post subject: Redirecting using Mod rewrite

I have a website with unique urls for members like -www.site.com/member1
and I have folders corresponding to these with name "member1" in which their pictures are stored.

I currently place index.php in each of such folder so that whenever someone visits -www.site.com/member1 the index.php fetches the pictures and details from the database and shows the homepage for that user.

Now the problem is , if I have to make some change in the design/layout, I need to update all the index.php files in these folders and that is really cumbersome.

I am looking for a method using htaccess to accomplish this so that I dont have to place any php file in these folders.

Please suggest.

_________________
Audio Ads - Earn from every visitor to your site
Buy Latest mobiles *** SEO India
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 14279

Redirecting using Mod rewritePosted: Tue Dec 19, 2006 4:37 pm    Post subject: Re: Redirecting using Mod rewrite

Maybe you could recall us where this came form Wink

As well, it's more of an Apache mod rewrite topic, so, moved Rolling Eyes

Then, I think that in this particular case, mod_rewrite is actually not the solution. The solution for such problem is just to follow some Good old coding practice : separate php content and html layout.

Even, I think in your case that the index.php file should be as light and generic as possible, just required to include the real working code, in which content and design would be well separated.

It's not much more work at first while coding, and is a lot of time saved after Wink

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
nims
phpBB SEO Team
phpBB SEO Team


Joined: 11 Oct 2006
Posts: 243
Location: New Delhi, India

Redirecting using Mod rewritePosted: Wed Dec 20, 2006 5:40 am    Post subject: Re: Redirecting using Mod rewrite

Can it be not done using htaccess by checking if the file requested in a folder doesnot exist and if its true then we run a script.php?var=$1 where $1 is the folder requested Smile

Something like this
Code:
.htaccess file
if request is for (directory) mod rewrite (directory) = (directory)/index.php
if (directory)/index.php does not exist
rewrite (directory)/index.php = script.php?var=(directory)


Smile

_________________
Audio Ads - Earn from every visitor to your site
Buy Latest mobiles *** SEO India
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: