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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.