Forum Moderators: phranque

Message Too Old, No Replies

How to rewrite this type of urls and create an entry page?

         

tpb101

7:51 pm on Nov 25, 2015 (gmt 0)

10+ Year Member



I have a php script, which creates urls like this:

domain.com/model/sunny-leone-133.html
domain.com/model/stoya-2.html
domain.com/model/kagney-linn-karter-14.html

I want all of them to appear as something like this:

domain.com/model/sunny-leone

The number on the end are needed for database lookups, so I guess they would be there, but now visible to the visitors, if this can be done this way.

I would then want to crate an entry page, something like this:

domain.com/go

and this could be entered with something like this:

domain.com/go?m=sunny-leone
domain.com/go?m=stoya
domain.com/go?m=kagney-linn-karter

and this would be redirecting to the specific model pages. I can work on that part, I am just not sure how to do the first, rewriting part, and if this can work this way. All model names would be unique.

Thanks.

lucy24

9:41 pm on Nov 25, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Wait, wait, you seem to be asking two different things.

example.com/pagename.html
example.com/pagename
example.com/otherpage?query-string-here

Only one of the three can be the URL that the user sees, and only one of the three can be the "real" file that your server ultimately uses.

You've posted in the Webmaster General forum. The exact mechanics of how-to-rewrite will depend on your server, each of which has its own subforum. If it happens to be Apache, I should warn you in advance that the question will probably receive an irritated response along the lines of "This is one of the ten most frequent questions asked at WebmasterWorld in the fifteen-plus years of its existence" (and afaik the answer is identical in everything from 1.3.0 to 2.4.99999). Well, that's probably true of IIS and nginx too; there just aren't as many of them in raw numbers.

tpb101

6:36 am on Nov 26, 2015 (gmt 0)

10+ Year Member



It is Apache. The urls are not the same, as I am talking about an age verification page, something like domain.com/enter.php based on its own code. Model names would be added to this as parameters, so where people click on domain.com/enter.php?m=sunny-leone, they would get to the age verification page, click yes, and then get redirected to the domain.com/model/sunny-leone-12.html page.

I guess this may not be possible overall, and I can crate a list of all the model pages as the numbers don't change. Then get people to the age verification page, and redirect them with php to that. The model pages would be read from something like a text file or a database.