CodeIgniter fresh copy works over LAN, but gets 403 over WAN - php

I'm starting a new CodeIgniter project, so I grabbed a fresh copy of version 2.1, and unarchived it to my local Apache root. I set up config.php and tested the site from localhost and another machine via the computer's LAN IP, and it worked as expected.
I also have my router forward WAN port 443 to port 80 on my server machine, so that I can access my Apache server from school (via wan_ip:443). This usually works fine, but when I try access my new CodeIgniter copy, I get a 403 Forbidden page.
I can still access all other sub-folders on my Apache server via WAN, including other, older, CodeIgniter projects.
There is no .htaccess file in the root of the fresh copy. I tried chmod-ing 755 and 777 recursively, but with no change.
Anybody have any idea what could be causing this? I've done quite a few CodeIgniter projects, and I've never had this issue.

I would have a look at the apache config maybe there is something related to the ip.
Also check your codeigniter config. Maybe it is doing some routing.
Try to replace your project with a simple index.html if that works apache is fine.
Check if your project itself does some redirect or something like this...

Turns out it was an Apache issue. I created an .htaccess file and added "Allow from all" to it, and now it works. I'm not sure why I needed to do that since I could access all my other Apache directories over WAN just fine, but it worked.

Related

Xampp Settings for localhost

I cant see my xampp settings: using this URL http://localhost/xampp/
This is the result im looking for:
I dont know why but if i look at examples, everyone's URL looks like http://localhost/xampp/ if i use this Url i get a page saying:
Object not found! The requested URL was not found on this server.
The directory is located in C:\xampp, and if i just add http://localhost/ as domain i get the tree structure of everything within C:\xampp\htdocs.
Also using Xampp v3.2.2 , if im in control panel and click on the Apache Config tab it open my file structure as mentioned above everything within C:\xampp\htdocs.
I just want to mention im using Windows, not Mac, but i meen both windows and mac has these Apache settings afcourse, i just dont get it how i cant find it using http://localhost/xampp/.
Apache & MySQL is switched on.
What i think could be the problem:
Could it be that im missing the /xampp directory within the /htdocs directory ?
Im not sure if there should be a xampp directory in htdocs but its the
only thing that makes sense?
Possible reason: Something is running with port 80
when you run Xampp, check the apache port no. ex: if it is displaying port 8012
then your url is http://localhost:8012/dashboard/
Check Directories for Xampp
Xampp directories.
more about this topic
For check all dependencies in the : httpd-xampp
The only reason i see is the xampp file should be located in the htdocs folder at least that is how i have it.
However i do not think that this will cause a problem for you in developing anything.
Hope this was helpful :)

WordPress on localhost can not be reached

I am using wamp to host a local version of my WordPress site. It was working gine until I restarted my computer and now I get this error.
This site can’t be reached
The connection was reset.
I tried restarting the services, and creating a new copy of this site under I different folder and the error still persists. My other non WordPress sites work fine.
Not sure what is going on so any suggestions would be great.
If you've moved your site to a different folder then the root has probably changed. Go to Preferences > Web Server and click on the folder next to Document Root, and navigate to the root directory that has your site then click on Select.
Also, make sure Apache and MySQL servers are running. Hope this helps.
You might have changed your port number from default port number.
Open with the port number that apache server is listening.
In your browser give "localhost:portNumber/WordPress"
Example: localhost:80/wordpress or
localhost:8080/wordpress or
localhost:8081/wordpress.
You Can check your port number from apache part config file.
Watch this video: https://www.youtube.com/watch?v=blmOFr8uZQI
I think its plugin issue from the codebase. Just rename the plugins name one by one in (wp-content/plugin/) folder and check.

Local site redirect to wrong address

So i have Ubuntu 16.04 with apache2 installed on it, and my local sites are inside if /var/www/html/ directory.
The problem is that one of my sites based on magento 1.9 redirect me to wrong url everytime. Whenever i'm trying to access localhost/my-site/ it redirects me to localhost/my-site/localhost/my-site/ instead.
I have tried to change .htaccess and even deleting it from site root folder same as changing apache2 hosts configurations inside of apache2/site-available folder and even creating new virtual host in that folder but that didn't helped.
I also tried to fully reinstall apache but no result. My hosts file has just localhost defined now so it can not be conflict with other host.
I think that it replace index.php url part with localhost/my-site but i have no idea how to fix it.
I would realy appreciate some help becose i'm trying to fix this few day already with no result.
Thanks.
Ok, I have solved this problem, by deleting cache folder on my local pc in /var/tmp directory. Apparently this cache was saved when i got redirect first time and after that i was redirecter becose of this.
Hope this will help someone.

XAMPP Ignores Document Root; Redirects to 'localhost/dashboard'

I have two computers, a laptop & desktop, with seemingly identical setups:
Running local server via XAMPP (for Windows, v 7.0.13)
Laravel-based project
In httpd.conf, DocumentRoot is set to D:/xampp/htdocs/site-folder/public
On the laptop, everything works as expected; visiting localhost in Chrome hits Laravel's public folder and the application fires up like it should. On the desktop, however, I get redirected to localhost/dashboard when I visit localhost. Typing out the full address (ie, localhost/site-folder/public) works, but all links are broken, as they expect the site-folder/public directory to be the root.
My assumption—and I hope I'm wrong about this—is that there are a lot of potential configuration settings that might be off. Any ideas on what might cause this, or how to go about debugging? Thanks in advance for any thoughts/suggestions!
This turned out to be the result of middleware I had in place, which required a secure connection. The middleware worked fine/as expected, but the httpd-ssl.conf file needed the updated project path. In case somebody else is experiencing a similar problem, try this:
Find the comment # General setup for the virtual host
Change DocumentRoot to the same project path used in your
httpd.conf
Appreciate all comments on the original question!

How to make xampp local wordpress installation public?

I installed XAMPP and WordPress along it. Created a database and installed the platform all along. Opened the needed ports (8080) so it's publicly accessible also before that. It works.
The problem is that the I can't reach http://IPaddress/wordpress/wp-admin from an outside computer.
I can reach http://IPaddress:8080/xampp/, but thats the only page it will allow me to open. For the rest I get timeouts, unreachable.
I'd appreciate if someone tells me how do I make the C:\xampp\htdocs\wordpress folder accessible publicly just like the /xampp one. Do I need to set some special permissions?
I recommend you next:
You should move Wordpress folder to htdocs.
Change apache port to 80, not 8080.
Open 80 port in your router to your host, example: 192.168.1.32
Change wordpress folder permissions.
Try http://IPADDRESS/
Anyway your solution is also in google.

Categories