944,047 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 882
  • PHP RSS
Oct 15th, 2007
0

htaccess

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
apwade is offline Offline
11 posts
since May 2007
Oct 15th, 2007
0

Re: htaccess

I have done this but using cpanel on my web hosts(going to the redirect link and/or page on the cpanel of the web host), i think it could be done, given time
Reputation Points: 10
Solved Threads: 0
Newbie Poster
omesa is offline Offline
21 posts
since Jun 2006
Oct 16th, 2007
0

Re: htaccess

Hi there

Lots of results from Google for general redirects.

Inside your .htaccess file -
Redirect 301 /oldpage.html http://www.target.com/newpage.html

or using meta tags in your page header:
<meta http-equiv="refresh" content="2;url=http://target.com">

Just an aside - you mention that your generic.htm contains php? You do realise that it must then be called generic.php in order for the php interpreter to pick it up?

Hope this helps. 8-)
Reputation Points: 12
Solved Threads: 8
Junior Poster in Training
RoryGren is offline Offline
60 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP gurus: Technology in PHP that has same capability of google book.
Next Thread in PHP Forum Timeline: how to call Stored Procedure in mysql by php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC