Jump to content

Rewrite URL


girish.kc

Recommended Posts

Hi,

Is there a way to modify the incoming URL request with rewrite?

In my case, I have an external application calling mine with the URL

I want this to be rewritten as

 

I tried the following .htaccess to do that.

 

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^folder$ /folder/index.php [L]
</IfModule>

 

 

But the problem here is, this is a POST request and because of rewrite server is sending back the '301  Moved Permanently' status back to the requester.

 

Is there any way I can skip sending 301 and redirect without loosing the POST data?

 

Thanks,

Girish

 

Link to comment
https://forums.phpfreaks.com/topic/266655-rewrite-url/
Share on other sites

Yes. I have the index.php in DirectoryIndex,

But for the request "https://api.xyz.com/folder" I am getting the following response

 

Date: Tue, 07 Aug 2012 05:43:55 GMT

Server: Apache

Location: https://api.xyz.com/folder/

Content-Length: 243

Keep-Alive: timeout=1, max=10000

Connection: Keep-Alive

Content-Type: text/html; charset=iso-8859-1

 

 

Link to comment
https://forums.phpfreaks.com/topic/266655-rewrite-url/#findComment-1367400
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.