# Nginx rewite base file name help!

**URL:** <https://www.ruby-forum.com/t/nginx-rewite-base-file-name-help/224001>\
**Category:** NGINX\
**Created:** [October 26, 2012, 9:56am UTC](https://www.ruby-forum.com/t/nginx-rewite-base-file-name-help/224001 "2012-10-26T09:56:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [October 26, 2012, 9:56am UTC](https://www.ruby-forum.com/t/nginx-rewite-base-file-name-help/224001/1 "2012-10-26T09:56:11Z")

</div>

[http://pic.test.com/view.php?filename=947284035\_234601603334998.jpg](http://pic.test.com/view.php?filename=947284035_234601603334998.jpg)

to

[http://pic.test.com/947284035\_234601603334998](http://pic.test.com/947284035_234601603334998)

base file name

thanks

Posted at Nginx Forum:

> **[nginx rewite base file name help!](https://forum.nginx.org/read.php?2,232243,232243#msg-232243)**
>
> http://pic.test.com/view.php?filename=947284035\_234601603334998.jpg to http://pic.test.com/947284035\_234601603334998 base file name thanks

---

<div class="post-metadata">

**Author:** ![abcomp01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@abcomp01](https://www.ruby-forum.com/u/abcomp01)\
**Post date:** [October 26, 2012, 12:08pm UTC](https://www.ruby-forum.com/t/nginx-rewite-base-file-name-help/224001/2 "2012-10-26T12:08:48Z")

</div>

On 26 October 2012 08:55, abcomp01 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [http://pic.test.com/view.php?filename=947284035\_234601603334998.jpg](http://pic.test.com/view.php?filename=947284035_234601603334998.jpg)
> 
> to
> 
> [http://pic.test.com/947284035\_234601603334998](http://pic.test.com/947284035_234601603334998)
> 
> base file name

This is very doable, and you should be able to work it out yourself  
after reading these:

[http://wiki.nginx.org/HttpRewriteModule#rewrite](http://wiki.nginx.org/HttpRewriteModule#rewrite)  
and  
[http://wiki.nginx.org/HttpCoreModule#Variables](http://wiki.nginx.org/HttpCoreModule#Variables)

## Cheers, Jonathan

Jonathan M. // Oxford, London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
