I have developed a site in CodeIgniter, it was working perfectly in my old server as I have changed new server which is in GoDaddy it gives the following error:
Not Found
The requested URL /Foldername/authorise was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at "siteurl" Port 80
actually this process coming after login in this site
Thanks in advance
Did you remember to also move the .htaccess ?
It sounds like a rewrite-problem.
Did you change the base_url in the application/config.php as per new server.
Or if there is mod rewrite problem then follow the steps:
copy rewrite.load and ssl.load from mods-available to mods-enable.
copy default-ssl from sites-available to sites-enable and change as
From:
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
To:
Options Indexes FollowSymLinks MultiViews
RewriteEngine On
AllowOverride all
Order allow,deny
allow from all
To make .htaccess files work as expected, you need to edit this file:
/etc/apache2/sites-available/default
Look for a section that looks like this:
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
You need to modify the line containing AllowOverride None to read AllowOverride All. This tells Apache that it's okay to allow .htaccess files to over-ride previous directives. You must reload Apache before this change will have an effect:
sudo /etc/init.d/apache2 reload
Related
I imported a wordpress production website into my local server to modify it and learn how to wordpress. I use LAMP and my WordPress project is located on a different Hard Drive than my Ubuntu 16.04 partition. But even if I can access to the main page, all the other links (except /wp-admin) are returning a 404 not found error.
As I could read, the problem could be that the .htaccess file was not read by apache2. To enable this option, I needed to enable the plugin rewrite with sudo a2enmode rewrite and to change in /etc/apache2/sites-enabled/000-default.conf the :
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
by :
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
If this may correct the error 404, it creates an internal server error...
Is anyone have an idea of how to handle this problem ?
Thank you !
Have you flushed the rewrite rules yet?
Go to Settings -> Permalinks and hit save.
Alternatively, you can do it from your theme by calling the flush_rewrite_rules() function.
As I needed to use the directory on my other HDD for every dev project, I changed the Server root of Apache2 and it resolves my problems
I have installed WAMP on my windows 8 machine. When i browse to localhost in my browser, the WAMP server page is visible.
But when I browse to my IP in my browser, I get the message
403 Forbidden: You don't have permission to access / on this server.
i downloaded wamp server from this page
http://sourceforge.net/projects/wampserver/
and in C:\wamp\alias phpmyadmin file
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.5.1/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
Any suggestions?
Sounds like you need to make the same changes you made in the phpmyadmin config file to the Apache config file httpd.conf, by default Apache only allows localhost access. Search for httpd.conf and make changes ,I don't know where conf file would be placed by default on Windows box.
You could change :
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
into:
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
That's in my file. Maybe this will help you. You also didn't say if http://localhost or http://127.0.0.1 works fine
But in fact it should work just right after install. If it's not maybe you should try to uninstall wamp and install again.
However if I were you I would consider using another wamp server. I've also used this one but updates are not very often, there are problem with switching php version if you need to do more testing. I recently have moved to http://www.easyphp.org/ and it works very nice, I can switch between php versions without problems and new versions (php/phpmyadmin) appear almost just after release date so I recommend you to test this one.
I just installed WAP 2.2 d, on my local machine. It runs on Wndows 7 Starter. The installation was done smoothly. Then when I hit the URL localhost/phpmyadmin it gave me a message
**Forbidden**
You don't have permission to access /phpmyadmin/on this server.
Then after doing some research on this issue I found one solution as to make the change in file wamp/alias/phpmyadmin.conf
The initial lines were
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
Order Deny, Allow
Deny from all
Allow from 127.0.0.1
</Directory>
I changed these line to following lines:
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow, Deny
Allow from all
</Directory>
Then the phpMyadmin started working properly at URL localhost/phpmyadmin
After that I copied my directory 'XYZ' containing small project of PHP. Hit the URL localhost/XYZ, then it was expected to run the index.php file from the folder XYZ but it's still giving me the error
**Forbidden**
You don't have permission to access /XYZ on this server.
Can you help me to resolve this issue and run the system properly. Except above change to wamp/alias/phpmyadmin.conf I've not done any change to any of configuration file. Thanks in advance.
You must allow access to your XYZ directory in Apache configuration file httpd.conf:
<Directory "c:/wamp/apps/XYZ">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow, Deny
Allow from all
</Directory>
The reason for this problem is most likely because W7 has IPV4 and IPV6 enabled.
Apache is happy to listen to both ranges of port numbers, and by default does.
A better more secure solution would be:
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
Require local
</Directory>
Require local is like saying Allow from 127.0.0.1 localhost ::1 i.e. both IP Address ranges alias's for this PC.
Also if you do as you did and Allow from all when you decide to show a friend what you have done and open you router so the world can see your new site, they will also be given access to phpMyAdmin making a hackers life really easy
Secondly, you do not make the change suggested by #user4035, instead edit the httpd.conf and look for this section
<Directory "d:/wamp/www/">
Where is says,
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Change it in the same way as above, to
Require local
For the same security reason as above. When the time comes to show the world your site you can add the
<Directory "c:/wamp/apps/XYZ">
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
To allow anybody to see just that website but nothing else.
I have built a Zend Framework application. By configuring it to read routes.ini file, my application after deployment is not going to any routes but only default route is working. I have total of 4 routes in this application and none of them are working. Apache is showing a Not Found error.
I had look at .htaccess file it is perfect and in my local it is working fine. I also checked the permissions. It is having read and write rights for www-data. I also checked Apache URL rewrite module.
I did this again and tried:
sudo a2enmod rewrite
Still same issue.
My apache error log says that file does not exist.
Please tell me where I have gone wrong.
After researching for hours , I could notice that there was a very minor and sensitive mistake in the apache vhost file .
my entry was like this
<Directory /var/www/your_project>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
But actually my entry should be as per mssb some what like this
<Directory /var/www/your_project>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory
Since I am not an experienced webmaster I couldn't noticed one simple thing which is
AllowOveride option which was set to None
I referred to Core apace documentation today in order find where I was wrong .
The reason for not picking .htaccess file is as follows
When AllowOveride directive is set to None, then .htaccess files are
completely ignored. In this case, the server will not even attempt to
read .htaccess files in the filesystem.
When this directive is set to All, then any directive which has the
.htaccess Context is allowed in .htaccess files.
I personally felt like Posting this entire solution for the problem to help others who may face a similar problem in future
Once again I would like to thank you all for responding to this post
Try following steps to mod_rewrite
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
sudo gedit /etc/apache2/sites-enabled/000-default
add following codes
<Directory /var/www/your_prject_name>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>
then restart the server
sudo /etc/init.d/apache2 restart
Does anyone know why this is?
I have read various things about changing the httpd.conf file but
the information varies and is conflicting
what is said to be in the file is not in the same format and there are two versions of what is meant to be there i.e. <Directory /> </Directory> and <Directory something else> </Directory>
The original PHP 5.4.3/Apache 2.4.2 is working fine but I can't see enough similar points of reference to be able to copy the httpd.conf settings over into the file for Apache 2.2.2 (which I am using with PHP 5.3.1.
Lines 160-166:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
Lines 305-310:
<Directory "cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
Or is it something completely different?
You will need to add the following lines to httpd.conf:
# This tells Apache where to look for phpmyadmin
Alias /phpmyadmin C:/wamp/apps/phpmyadmin3.5.1
# This gives permission to serve the directory
<Directory C:/wamp/apps/phpmyadmin3.5.1>
Options None
AllowOverride None
# This allows eveyone to access phpmyadmin, which you may not want
Order Allow,Deny
Allow from all
</Directory>
Once you have made these modifications and restarted Apache, it should work.
I suspect the first line may already be present, because you are getting a 403 and not a 404.