Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7840233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:42:38+00:00 2026-06-02T15:42:38+00:00

I have a website hosted on my local server (http://localhost/), which uses url_rewriting. When

  • 0

I have a website hosted on my local server (http://localhost/), which uses url_rewriting.

When I access a page with the browser, no issue, it’s loading.
But when I access the same url with PHP cUrl, I get a 404.

Example:
URL with mod_rewrite: http://localhost/site/test
Real page: http://localhost/site/test.php

Loading http://localhost/site/test from Firefox: Working

Loading using cUrl:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/site/test");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$output = curl_exec($ch);
curl_close($ch);

$output -> 404 page from apache

Anybody knows why cUrl returns a 404 message?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:42:40+00:00Added an answer on June 2, 2026 at 3:42 pm

    Turns out this has nothing to do with mod_rewrite.
    One of the directory in the URL had a space in it, that I was not encoding when calling the cUrl function.
    Once replaced all space by %20, everything worked fine.

    Subject closed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a local server with an access database which feeds data to clients
I have a website hosted on a Linux server. If someone sends me an
I have an ASP.Net hosted website which displays a list of results as a
I have a website hosted on my web server contacting a secure web service
I have a WCF service hosted at local IIS. I created a ASP.NET website
I have an IIS-7-hosted website which is accessible by everyone (public domain), and it
I have a website hosted by 1and1. On the server there is a folder
I have a website hosted on amazon. I want my clients to give access
i have developed a website and hosted it.. in the local system it is
I have a website hosted with godaddy. Basically for my work I use TFS.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.