Stange rewrite
I am busy migrating code from my old MacBook to a new MacBook. Haven't looked at this code for a couple of years, and struggling to get it working again, even though it works on my old laptop.
I have a mod_rewrite that rewrites the home page from "http://local.mysite/index.php" to simply "http://local.mysite/" Something isn't working correctly, so I renamed my .htaccess file to "xxx.htaccess" to disable it. However, when I go to "http://local.mysite/index.php" it is still getting rewritten?! I am wondering if something is filled out incorrectly in my httpd.conf file? Would that explain the strange rewrite? |
Besides the .htaccess file, what would cause a URL rewrite when I go to "http://local.mysite/index.php"
|
Have you checked the real configuration files for the web server? .htaccess is not the normal place for the redirects for most use-cases.
|
Quote:
So let me start over and explain what is happening in greater detail... In DEV and using my IDE, I launch the "index.php" file. With the .htaccess file removed, I would expect my browser to load: http://local.mysite/index.php However, what is instead appearing is: http://local.mysite/Users/user1/Documents/path/to/my/webroot/at/public_html/ There is no .htaccess present, so how is the rewrite happening?? Follow me? The only thing I can think of is there is a problem in my httpd.conf file, although I swear this was all working last week?! |
Sanity check: You are restarting the web server after each change, yes?
Have you tried searching httpd.conf and httpd.d/* for that string, or parts of it? Or for Rewrite directives? What else have you tried? Are there any clues in the access or error logs? |
Quote:
Quote:
Could this have to do with the virtual host I created? Quote:
I guess the main thing I did was to rename the .htaccess file to eliminate that the following mod_rewrite migt be the issue... Code:
RewriteEngine on So something else is causing a redirect when my IDE tries to launch "index.php". All of this is so frustrating! |
I looked in the log and it says...
Code:
[Date] [error] [client 127.0.0.1] File does not exist: /Users/user1/Documents/path/to/public_html/User Not sure what the /User part is and whether or not the error message is getting truncated off or not? As I mentioned in my last post, in my browser I see that it is putting in the entire file path to the webroot AFTER the webhost... http://local.mysite/Users/user1/Docu...o/public_html/ |
So now what?
|
Please stop bumping your thread. To do so without providing further information or clarification is against the LQ rules.
We're waiting for your responses to #5. What is MAMP? Is that the web server? |
Quote:
Quote:
|
This is absolutely MADDENING!!! :banghead:
Everything has been working fine for the last week, and all of a sudden things are broken?! Here is what I have dine so far... First, I went into: /Applications/MMAP/conf/apache/httpd.conf Here is what is in my httpd.conf the file including some changes... Code:
ServerRoot "/Applications/MAMP/Library" I saved this, shut down MAMP, and rebooted my MacBook. After starting up, and turning things back on, I went into NetBeans and launched "indoex.php" and it loaded my home page in Firefox just fine. (So the URL was: "http://local.mysite/indoex.php") Then I went and renamed "+++.htaccess" back to ".htaccess". In my .htaccess file, I stripped thingsd own to this... Code:
RewriteEngine on Again, I shut down my MacBook. After rebooting, I went back into NetBeans, and launched "index.php". Unfortunately, this time my home page doesn't load and the address bar says: http://local.mysite/Users/user1/Documents/path/to/public_html/ All of this has been working just fine for the last few weeks, and then a day ago I ran into this. As far as I can recall, I don't believe I changed anything in my httpd.conf file or my .htaccess file. I do recall tweaking my php.ini file, but can't think of anything that would have caused what i am seeing now?! What in the world is going on??? :( |
Please post
Code:
ls -l /Users/user1/Documents/path/to/public_html |
Quote:
Here is the command I ran: Code:
user1$ ls -l /Users/user1/Documents/30-ACME/10-INFORMATION TECHNOLOGY/++htdocs/01-ACME/public_html Here are the results I got: Code:
ls: /Users/user1/Documents/30-ACME/10-INFORMATION: No such file or directory Looks like that is the problem, right? So how can I fix this issue and not mess up a filing scheme that took me a long time to come up with?! :confused: |
Remove the space in the name of the directory...spaces in directory or file names on a Linux system are problematic. Replace with an underscore?
To execute the ls with the space, quote the path. |
Quote:
Apparently this is still not true for maOC and Linux, huh? ***** And as far as the problem I have been having, I wanted to add these comments to help you help me to troubleshoot... If I get into my IDE and launch "index.php" I get the page not found issue described above. HOWEVER, if I go into a newly launched browser window, and type either of these URL's the page loads: http://local.mysite/index.php http://local.mysite/ http://local.mysite So why do these URL's work when manually typed into the address bar, but if I try and launch my home page using my IDE, it fails? Shouldn't the space in my directory structure break things every time? Also, why didn't I have this problem last week or the week before, but now all of a sudden it is an issue? (I came up with my new folder paradigm back around Thanksgiving and things seemed to be working okay in my IDE?!) |
All times are GMT -5. The time now is 11:53 AM. |