# Rewrite

**URL:** <https://www.ruby-forum.com/t/rewrite/207713>\
**Category:** NGINX\
**Created:** [June 1, 2011, 5:07am UTC](https://www.ruby-forum.com/t/rewrite/207713 "2011-06-01T05:07:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 1, 2011, 5:07am UTC](https://www.ruby-forum.com/t/rewrite/207713/1 "2011-06-01T05:07:57Z")

</div>

Hello,

i have write my own Blog now, and the sites ended with id. Thats not  
good for  
the visitors and the search engine so i think. Is there are a way that i  
can  
write the webpage Adress like blogdetail.html?id=1 in a title for  
example.

blogdetail.html?id=1 → [www.mysite.com/whatismoney](http://www.mysite.com/whatismoney) (as example)  
blogdetail.html?id=2 → [www.mysite.com/thenextentry](http://www.mysite.com/thenextentry) (as example)

I think i want use the Headline from the article.

Can i make this with nginx? Cam give me someone a example, because the  
website  
[Module ngx\_http\_rewrite\_module](http://wiki.nginx.org/HttpRewriteModule) i understand not correct or im  
to long  
at pc today.

Thanks for help.

Silvio

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 5:15am UTC](https://www.ruby-forum.com/t/rewrite/207713/2 "2011-06-01T05:15:25Z")

</div>

On Wed, Jun 1, 2011 at 10:07 AM, Silvio S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hello,
> 
> i have write my own Blog now, and the sites ended with id. Thats not good for  
> the visitors and the search engine so i think. Is there are a way that i can  
> write the webpage Adress like blogdetail.html?id=1 in a title for example.
> 
> blogdetail.html?id=1 → [www.mysite.com/whatismoney](http://www.mysite.com/whatismoney) (as example)  
> blogdetail.html?id=2 → [www.mysite.com/thenextentry](http://www.mysite.com/thenextentry) (as example)

This is usually handled by the application.

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 10:29am UTC](https://www.ruby-forum.com/t/rewrite/207713/3 "2011-06-01T10:29:10Z")

</div>

On Wed, 1 Jun 2011 10:14:38 +0700 Edho P Arief wrote:

> This is usually handled by the application.

What for application? Im not use a application, i has write my own blog,  
want not Wordpress, Typo, Contao or what ever. That is write by me self.

That is why i ask, i understand the rewrite rules not.

Silvio

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 10:46am UTC](https://www.ruby-forum.com/t/rewrite/207713/4 "2011-06-01T10:46:31Z")

</div>

On Wed, Jun 1, 2011 at 3:28 PM, Silvio S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On Wed, 1 Jun 2011 10:14:38 +0700 Edho P Arief wrote:
> 
> > This is usually handled by the application.
> 
> What for application? Im not use a application, i has write my own blog,  
> want not Wordpress, Typo, Contao or what ever. That is write by me self.
> 
> That is why i ask, i understand the rewrite rules not.

as long it’s not static html then it’s an application.

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 10:53am UTC](https://www.ruby-forum.com/t/rewrite/207713/5 "2011-06-01T10:53:56Z")

</div>

On Wed, 1 Jun 2011 15:45:57 +0700 Edho P Arief wrote:

> as long it’s not static html then it’s an application.

Aha. So i can not use Rewrite Rules.

Silvio

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 11:00am UTC](https://www.ruby-forum.com/t/rewrite/207713/6 "2011-06-01T11:00:45Z")

</div>

On Wed, Jun 01, 2011 at 03:56:18PM +0700, Edho P Arief wrote:

> /page/1 ===\> /page.php?id=1
> 
> if it’s something seo-ish like this:
> 
> /my-cool-story ===\> /page.php?id=1
> 
> then it must be handled by the application

Even it is as simple as the first example, I can not understand  
WHY people relies on gobbledygook of rewrite rules instead of  
using high level programming language like PHP.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 10:57am UTC](https://www.ruby-forum.com/t/rewrite/207713/7 "2011-06-01T10:57:02Z")

</div>

On Wed, Jun 1, 2011 at 3:53 PM, Silvio S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On Wed, 1 Jun 2011 15:45:57 +0700 Edho P Arief wrote:
> 
> > as long it’s not static html then it’s an application.
> 
> Aha. So i can not use Rewrite Rules.

you can but it’ll be tedious unless you meant a simple mapping like  
this:

/page/1 ===\> /page.php?id=1

if it’s something seo-ish like this:

/my-cool-story ===\> /page.php?id=1

then it must be handled by the application

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 11:05am UTC](https://www.ruby-forum.com/t/rewrite/207713/8 "2011-06-01T11:05:05Z")

</div>

Hello,

On Wed, 1 Jun 2011 15:56:18 +0700 Edho P Arief wrote:

> you can but it’ll be tedious unless you meant a simple mapping like this:
> 
> /page/1 ===\> /page.php?id=1
> 
> if it’s something seo-ish like this:
> 
> /my-cool-story ===\> /page.php?id=1
> 
> then it must be handled by the application

Aha so it means. You mean i should this relized with PHP.

Regards  
Silvio

---

<div class="post-metadata">

**Author:** ![silviosilva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5daacb/32.png) [@silviosilva](https://www.ruby-forum.com/u/silviosilva)\
**Post date:** [June 1, 2011, 11:14am UTC](https://www.ruby-forum.com/t/rewrite/207713/9 "2011-06-01T11:14:59Z")

</div>

Hello,

On Wed, 1 Jun 2011 13:00:31 +0400 Igor S. wrote:

> Even it is as simple as the first example, I can not understand  
> WHY people relies on gobbledygook of rewrite rules instead of  
> using high level programming language like PHP.

Oh u be the the inventor of Nginx, this is an honor. Thanks for nginx,  
im more friendly with it, as before. I read a lot of Maillinglists, im  
so long use OpenSource Software but never has a dialog with a Inventor  
of a project. I think its nice day today.

So want come back to what i want write to the subject:

I want be honestly, that blog, with comments, RSS Feed and the Secure  
Points  
was my first steps in PHP. Im happy that i could relized the “Project”  
so.  
More PHP Expirence i have not and so i not know how should it relized. I  
know  
it goes, i think its with location header. So i think, nginx has a  
rewrite  
Module, and it were easier as PHP.

Sure with PHP were better, because i can use the Mysql Table, is  
automatic i  
think, the nginx configuration i must write.

Regards  
Silvio
