| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
nims phpBB SEO Team

Joined: 11 Oct 2006 Posts: 243 Location: New Delhi, India
|
Posted: 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 |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 14279
|
Posted: Tue Dec 19, 2006 4:37 pm Post subject: Re: Redirecting using Mod rewrite |
|
|
Maybe you could recall us where this came form
As well, it's more of an Apache mod rewrite topic, so, moved
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
++ |
_________________ 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 |
|
 |
nims phpBB SEO Team

Joined: 11 Oct 2006 Posts: 243 Location: New Delhi, India
|
Posted: 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
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) |
 |
_________________ Audio Ads - Earn from every visitor to your site
Buy Latest mobiles *** SEO India |
|
| Back to top |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |