webguy262 Posted February 18, 2012 Share Posted February 18, 2012 Working on a site with a couple hundred virtually identical landing pages to maximize SEO. Rather than hard code the pages, I am wondering if there is a way to have one page that handles all the url's and dynamically codes and loads with title, keywords, content & alt tags all specific to the particular url requested. Seems like the challenge is doing it in a way that does not constitute a redirect. Is it better to do this in the .htaccess? Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/ Share on other sites More sharing options...
trq Posted February 18, 2012 Share Posted February 18, 2012 This is a pretty straight forward and common approach, where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318717 Share on other sites More sharing options...
webguy262 Posted February 19, 2012 Author Share Posted February 19, 2012 Thanks for the response... The sitemap for the site will have links to ~200 landing pages that should ideally have url's ending in html. Rather than have to create ~200 distinct pages, I thought it might be possible to have all the xxx.html url's call the same php page, and dynamically serve up the various pages, with titles, keywords, alt tags, content, etc. programmed to reflect the url requested. I want to do this with pages that load as html pages, tho, not php pages with get's in the url. Thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318769 Share on other sites More sharing options...
trq Posted February 19, 2012 Share Posted February 19, 2012 I understand *what* your trying to do and as I stated, it is quite a common design. You haven't said where you are stuck. Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318790 Share on other sites More sharing options...
webguy262 Posted February 19, 2012 Author Share Posted February 19, 2012 I've got this in the htaccess... redirect 301 /newsite/oldfile.html http://newwebdesign.com/newsite/new.php ... and it is working. The new.php file will dynamically create the content I want IF i can access the URL of the file requested BEFORE the redirect. That is, I need to access 'oldfile' from new.php. Can that be done? Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318905 Share on other sites More sharing options...
webguy262 Posted February 19, 2012 Author Share Posted February 19, 2012 also on the wish list, after the redirect, the browser should display the original requested url Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318912 Share on other sites More sharing options...
kicken Posted February 19, 2012 Share Posted February 19, 2012 You'd have to configure your server to treat those 200 urls as being served by the same script. Most likely a RewriteRule would handle this the easiest. Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1318929 Share on other sites More sharing options...
trq Posted February 19, 2012 Share Posted February 19, 2012 Yeah, you don't want to be using a redirect. Quote Link to comment https://forums.phpfreaks.com/topic/257270-serve-dynamic-content-based-only-on-url-requested/#findComment-1319003 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.