iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-02-2007, 03:35 AM
WebProWorld Member
 
Join Date: May 2007
Location: Grimsargh, UK
Posts: 39
apwade RepRank 0
Default .htaccess

I am trying to redirect a directory and all pages e.g. /shops/merchant1.htm to a generic file generic.htm using htaccess, does any have any ideas how to do this?

Also the generic.htm contains php.

I currently have hundreds of shops each with its own htm page, but i really want one generic.htm page that will cover all the shops, but driven by php and a mysql database. This would save dramatically on admin work generating a new page for each new merchant when it could be driven by one page reading the url address to modify the page to suit the new merchant.

Cheers,

Andrew
__________________
Discount shopping vouchers
Reply With Quote
  #2 (permalink)  
Old 10-11-2007, 04:29 AM
WebProWorld Member
 
Join Date: May 2007
Location: Grimsargh, UK
Posts: 39
apwade RepRank 0
Default Re: .htaccess

I am surprised nobody knows the answer to this question I am sure loads of sites would require this sort of functionality.

It is possible by using mod rewrite and has saved me loads of admin work on my website.
__________________
Discount shopping vouchers
Reply With Quote
  #3 (permalink)  
Old 10-12-2007, 07:05 AM
chadhaajay's Avatar
WebProWorld Pro
 
Join Date: Dec 2003
Location: INDIA
Posts: 160
chadhaajay RepRank 1
Default Re: .htaccess

Yes it is possible using a 301 Redirect and here is sample code to accomplish this scenario.

redirect 301 /test http://www.your-website-url-comes-here.com

Put this code in your .htaccess file and put this file in your website's root folder. Now, whenever someone will try to open http://www.your-website-url-comes-here.com/test/ or any file in test folder then it will redirect the borswer to http://www.your-website-url-comes-here.com
Sincerely,

Ajay Chadha (Director)
Chadha Software Technologies
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess commands apwade Web Programming Discussion Forum 6 08-15-2007 03:45 PM
.htaccess troubles. Sub Rosa Internet Security Discussion Forum 3 06-22-2007 06:32 PM
.htaccess a lot simpler HostEBiz Search Engine Optimization Forum 0 08-15-2006 08:22 AM
What is .htaccess and how does it work? complete Web Programming Discussion Forum 1 01-02-2006 07:40 AM
.htaccess question jestep Web Programming Discussion Forum 2 06-09-2005 01:07 PM


All times are GMT -4. The time now is 12:00 PM.



Search Engine Optimization by vBSEO 3.3.0