Apache redirection problem! - apache

I am setting up a pre-built website built in php. The site was actually hosted on the linux server. Now I am trying to set it up on a Window machine with WAMP server. In this website almost every page request passes through a particular file called redirect(which is basically a php file without extension).
Now the problem is that when I inspected the configuration(httpd.conf, apache.conf,.htaccess, vhost.conf etc) of the apache server on the linux machine, I nowhere found the redirect rules for doing so. Neither mod_rewrite nor mod_alias rules for this redirection were found there. But is still redirects the request properly. I also noticed that Zend Framework library is there in the exact same directory where the redirect file is. This library is included in the include_path in php.ini. However, the web site is still not developed using Zend MVC and I have seen NO proof of ZEND being used there.
So I am really confused how this redirection is working there? I am unable to set up this on window machine without rewrite rules of mod_rewrite or mod_alias. Do you guys know any alternative of both the said modules for redirection?
I know the site is really weird, but i have to set it up. :)
Thanks in advance for your help.

I found the answer!!! :)
It was NGINX being used as Web Server Proxy before the request get passed to Apache daemon. So , there was NO redirect rules using mod_alias or mod_rewrite modules of Apache. The rule was written in configuration of NGINX.
It was really hard for me to find out this because the application was setup by somebody elsea and I had to fix that application. :)
Any how problem is resolved!!!!!! :)

Related

SSI (Apache) not working on brand new Ubuntu 16.04 VPS

So, I just set up a brand new VPS, installed LAMP, all systems and services working.
I've tried almost everything I could find here on Stack Overflow and other guides, ranging from adding things to Apache's default.conf, to including almost every possible directive in .htaccess known to man (though I hear I technically don't need to use .htaccess, since I have root access?).
I do know that .htaccess is working because I can successfully used DirectoryIndex.
Not sure if relevant, I am using PHP 7.0.
If anyone needs more specific information, I can quickly find it. I really want SSI to be working!
Thanks!
I figured it out finally, for some reason I stumbled upon an entirely different SO thread which had the answer.
I never enabled include.
SOLUTION: a2enmod include.

When installing a new Silverstripe project - mod_rewrite is not enabled?

I am using MAMP Pro and for some reason now when I am installing a new silverstripe project it says:
URL rewriting support - You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.
It never used to do this, and have not had a problem in the past with it.
I have checked my httpd.conf and it is it there, I also checked the 'hosts' tab in MAMP Pro and mod_rewrite is checked.
Any idea as to why it is doing this?
So after abit more testing, it seems as though you need to restart MAMP Pro after you have installed silverstripe to get the URL's to rewrite.

Maintenance page on apache 7

I want to redirect to a maintenance page when my apache server is down.I tried through
htacess
and nothing worked.. Please direct me to some working blog.
Thanks...
The .htaccess file contains no executable program code to do some activities. If you want to show a webpage then you need a running webserver. If you have no one bad luck.
Take a look at this post about the technicel enviroment to reach your goal.
Edit: I found another post about this topic, though the same thing is the use of an additional webserver.

Newly transferred Drupal site - Clean URL broken

I had a drupal site on my local wamp server but after having to reformat my computer and reinstalling wamp and all that, Clean URLS is messing up. I made sure my apache had mod_rewrite enabled and after that i just get a 404 error for everything. When i try to login i also get a 404 error. What can i do? I've looked for a while and cant find anything.
I believe it's mod_rewrite that needs to be enabled.
Got it to work. Had to navigate to the login page directly (/?q=user) rather then just using the login block. Then navigated directly to the clean url page (www.mydomain.com/?q=admin/config/search/clean-urls) and disabled them.

Apache giving pages as downloads rather than displaying them

I just installed MediaWiki on a website and I am having some problems.
Whenever I go to "www.something.com/wikidir" the server gives me the PHP index file as an unnamed download instead of displaying it.
However, if I go to "www.something.com/wikidir/index.php" everything works as expected.
I'm not familiar with Apache and was wondering if someone could tell me how to fix this or point me in the right direction?
I'm using a LAMP stack and Mediawiki 1.7.1 (old I know).
In my .htacces file I have:
AddType application/x-httpd-php5 .php
Sounds like Apache (or PHP?) is serving the page as an application/octet-stream. You can check this by looking at the response headers on the non-index.php page. Firefox can do this using the Web Developer Toolbar > Information > View Response Headers. Look for "Content-Type"
Or, Does the non-index.php link work in IE? Does it go straight to download in Firefox (or another browser)? If the answer is yes, that's the problem.
How to fix it is more complex because there could be a bunch of different things that are causing this. My guess is that's it's an Apache config issue.
Edit
Check your .htaccess file. Make sure it's readable by Apache. I bet that's the issue.