You can make friendly urls in ASP equal to Wordpress?

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

You can make friendly urls in ASP equal to Wordpress?

12 Mar 2013, 09:36

You can make url friendly in ASP as in Wordpress?

I have ISAPI Rewrite on the server but the best I could make was this:

www.mysite.com.br/n/8,21,99656312--inscriptions-to-open-championship

The original address is this:

www.mysite.com.br/n.asp?c=8&co=21&id=99656312&t=inscriptions-to-open-championship

c = category
co = position (which is no longer used)
id = id
t = title


My question: Is it possible to capture only that part: "inscriptions-to-open-championship" and do understand that the site is open to the news?

I created a system that records the slug slug news in a field in mysql db.

So I think it could catch the url slug, compared with the mysql db and bring to the screen by the category id and other data news.


You can catch this slug in the db and make the site through ISA Rewrite understand that is to open the file n.asp but not show in the address bar of the file name?


Anyone have any tips?


Thanks for everyone's attention.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

12 Mar 2013, 22:59

Hello,

My question: Is it possible to capture only that part: "inscriptions-to-open-championship" and do understand that the site is open to the news?


Well, if "nscriptions-to-open-championship" defines all other parameter in URL, you can do that... but if you want to retrieve these entries straight from db, you'll need Helicon Ape(see http://www.helicontech.com/ape/doc/mod_dbd.htm). ISAPI_Rewrite is only capable of retrieving info from mapfile (see more in FAQ - http://www.helicontech.com/forum/10648-FAQ.html)

Regards
Andrew

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 08:53

Dear HeliconAndrew,

firstly thanks for the help. I'm not a great programmer, I'm a bit limited.

You can help me build the code would look like?

First we need the code that would capture the url example:

www.mysite.com.br / inscriptions-to-open-championship

or better:

inscriptions-to-open-championship

And open the page eg news.asp. I could not even know how to do this.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 11:53

Hello,

We may suggest some things, but what option have you chosen?

Regards
Andrew

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 12:21

I thought if can type the url and instead of showing an error 404.html he news.asp redirected to the page where I could capture the url typed and compare with the slug db.
 
That's the idea:
 
ISAPI is not redirects to find news.asp
 
On page news.asp I capture this "open-championship-registrations" and compare with db not think there is going to 404.asp.
 
Perhaps this would not be best. I do not know if I traveled but it can work.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 12:39

I have concerns about the order of events.
The only way I can see it is:

- we check all requests in db
- if the entry is there - use db to redirect
- if not - use news.asp redirect

Does it make sense to you?

Regards
Andrew

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 13:57

Yes I certainly think it could work.

Whenever you have an input query first and then redirect. If not redirects to 404.html or default.asp.

But how would I do that?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 17:26

OK, give me couple examples of requests of both types to identify the patterns.

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 17:37

Forgive me but I did not.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

14 Mar 2013, 21:55

I'm not sure I understand

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

15 Mar 2013, 01:07

I said I did not understand what you wrote:

"OK, give me couple of examples of requests ambos types to Identify the patterns."

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

15 Mar 2013, 01:52

What requests do we need to work with for these rules? You mentioned:

www.mysite.com.br/n/8,21,99656312--inscriptions-to-open-championship

What other types of request we would need to match?

Regards
Andrew

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

15 Mar 2013, 08:36

This is what is currently on my site:

www.mysite.com.br/n/8,21,99656312 - inscriptions-to-open-championship

But I wish that it looks like:

www.mysite.com.br / inscriptions-to-open-championship

As in Wordpress.


Thanks.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: You can make friendly urls in ASP equal to Wordpress?

17 Mar 2013, 17:15

Hello,

LEts try with something simple. For example, we will take mapfiles and try to implement the following rules

Code: Select all
RewriteEngine On
RewriteMap mymap txt:map.txt

#/n/8,21,99656312--instructions   ---> /n/instructions
RewriteRule ^n/[^--]+--(.+) /n/$1 [NC,R=301,L]

#loads content from /n/8,21,99656312--instructions
RewriteCond ${mymap:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^n/([^/]+) /n/${mymap:$1} [NC,L]


The mapfile should be called map.txt and located beside the config file, in the same folder:

instructions 8,21,99656312--inscriptions-to-open-championship
anythingElse 4,3,43234--otherExample
page 1,2,344567889-page


I hope this is what you wanted.

Regards
Andrew

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

19 Jun 2013, 16:33

Hi

I have a problem seems the code below works, but the site take to carrregar.

You can test the slow to load here:

http://www.registro.sp.gov.br/n/programa-voleibol-adaptado-traz-beneficios-fisicos-sociais-a-terceira-idade-registro

Can you give me a hand, I wonder why the loading is slow.

The code that i feel this is using:

Code: Select all
RewriteRule ^n/(.*)/?$ /n.asp?n=$1 [NC,L]


Thanks

User avatar
Posts: 16
Joined: 12 Mar 2013, 09:10

Re: You can make friendly urls in ASP equal to Wordpress?

19 Jun 2013, 17:08

Please disregard the last message. I discovered the problem.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 5 guests