You can make friendly urls in ASP equal to Wordpress?
16 posts
• Page 1 of 1
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
You can make friendly urls in ASP equal to Wordpress?
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.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
Hello,
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
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
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
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.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
Hello,
We may suggest some things, but what option have you chosen?
Regards
Andrew
We may suggest some things, but what option have you chosen?
Regards
Andrew
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
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.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
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
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
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
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?
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?
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
OK, give me couple examples of requests of both types to identify the patterns.
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
Forgive me but I did not.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
I'm not sure I understand
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
I said I did not understand what you wrote:
"OK, give me couple of examples of requests ambos types to Identify the patterns."
"OK, give me couple of examples of requests ambos types to Identify the patterns."
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
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
www.mysite.com.br/n/8,21,99656312--inscriptions-to-open-championship
What other types of request we would need to match?
Regards
Andrew
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
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.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: You can make friendly urls in ASP equal to Wordpress?
Hello,
LEts try with something simple. For example, we will take mapfiles and try to implement the following rules
The mapfile should be called map.txt and located beside the config file, in the same folder:
I hope this is what you wanted.
Regards
Andrew
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
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
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:
Thanks
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
- insideinside
-
- Posts: 16
- Joined: 12 Mar 2013, 09:10
Re: You can make friendly urls in ASP equal to Wordpress?
Please disregard the last message. I discovered the problem.
16 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests