# Rewrite all php+args to php+args.html Q?

**URL:** <https://www.ruby-forum.com/t/rewrite-all-php-args-to-php-args-html-q/208032>\
**Category:** NGINX\
**Created:** [June 8, 2011, 5:27pm UTC](https://www.ruby-forum.com/t/rewrite-all-php-args-to-php-args-html-q/208032 "2011-06-08T17:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 8, 2011, 5:27pm UTC](https://www.ruby-forum.com/t/rewrite-all-php-args-to-php-args-html-q/208032/1 "2011-06-08T17:27:27Z")

</div>

Hello Nginx Gurus,  
We have a local mirrored with wget web site.  
All dynamic files are saved like this “list.php?type=80.html  
[\*.php?some args dot html]” but in href tags are  
  
How can we rewrite requested files to local html files except images,  
css and js which are ok.

 

Regards,

 

Posted at Nginx Forum:

> **[rewrite all php+args to php+args.html Q?](https://forum.nginx.org/read.php?2,205032,205032#msg-205032)**
>
> Hello Nginx Gurus, We have a local mirrored with wget web site. All dynamic files are saved like this "list.php?type=80.html \[\*.php?some args dot html\]" but in href tags are \<a href="list.php?type=80"\> How can we rewrite...

---

<div class="post-metadata">

**Author:** ![izrodix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3d9bf3/32.png) [@izrodix](https://www.ruby-forum.com/u/izrodix)\
**Post date:** [June 8, 2011, 5:52pm UTC](https://www.ruby-forum.com/t/rewrite-all-php-args-to-php-args-html-q/208032/2 "2011-06-08T17:52:47Z")

</div>

On Wed, Jun 08, 2011 at 11:26:51AM -0400, izrodix wrote:

> Hello Nginx Gurus,  
> We have a local mirrored with wget web site.  
> All dynamic files are saved like this “list.php?type=80.html  
> [\*.php?some args dot html]” but in href tags are  
>   
> How can we rewrite requested files to local html files except images,  
> css and js which are ok.

 

You may try

 

location / {  
root /path/to/files; # images, css, js  
}

 

location ~ .php$ {  
alias /path/to$request\_uri.html;  
}

 

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![izrodix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/3d9bf3/32.png) [@izrodix](https://www.ruby-forum.com/u/izrodix)\
**Post date:** [June 9, 2011, 1:57am UTC](https://www.ruby-forum.com/t/rewrite-all-php-args-to-php-args-html-q/208032/3 "2011-06-09T01:57:45Z")

</div>

Thanks a lot for the help Mr Sysoev.  
It works.

Posted at Nginx Forum:

> **[Re: rewrite all php+args to php+args.html Q? - solved](https://forum.nginx.org/read.php?2,205032,205135#msg-205135)**
>
> Hello Nginx Gurus, We have a local mirrored with wget web site. All dynamic files are saved like this "list.php?type=80.html \[\*.php?some args dot html\]" but in href tags are \<a href="list.php?type=80"\> How can we rewrite...
