monsterpot Posted November 13, 2009 Share Posted November 13, 2009 Hello This is what I am attempting to do: Articles I submit to directories will have a url in the resource box in the format www.domain.com?article_id=1234. When clicked by anyone, they will see www.domain.com and the article 1234 will be displayed, so it will appear article 1234 is on the domain.com home page (actually it could abe any HTML page I specify that would be the home page, not necessarily an article. It could be an opt in page etc ) Th epoint is another article might have a resoource link as www.domain.com?article_id=2345 and if clicked it would still show the root plus what ever 2345 related to. What I am doing is GETing the article_id from the querystring. Then I refer to a file that specifies what 1234 or 2345 refers to (e.g. this.html or that.html) and then it needs to display the appropriate html page BUT I can't get the root domain to remain in the address bar. Anyone got any ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/181449-php-redirect-retaining-domain-root-in-address-bar/ Share on other sites More sharing options...
trq Posted November 14, 2009 Share Posted November 14, 2009 BUT I can't get the root domain to remain in the address bar. Why would you want to do that? So no-one can book mark anything on your site? To have the domain name only permanently displayed within the address bar you will need to use frames. A better approach (IMO) if you don't like ?di=37364 is to use mod_rewrite to make clean urls like http://yourdomain.com/articlename, where articlename can be used within your logic to load the required data for the page. Link to comment https://forums.phpfreaks.com/topic/181449-php-redirect-retaining-domain-root-in-address-bar/#findComment-957186 Share on other sites More sharing options...
monsterpot Posted November 14, 2009 Author Share Posted November 14, 2009 BUT I can't get the root domain to remain in the address bar. Why would you want to do that? So no-one can book mark anything on your site? Some article services will only allow links to a root domain, not individual pages. So I couldn't add a resource link www.domain.com/article1234.html for example. This was an idea for a workaround. I will research the frames idea Link to comment https://forums.phpfreaks.com/topic/181449-php-redirect-retaining-domain-root-in-address-bar/#findComment-957190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.