Jump to content

PHP Redirect retaining domain root in address bar


monsterpot

Recommended Posts

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

 

 

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.

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.