Problems with apache and php project
So I've got this weird problem, I am trying to host a php codeigniter project but I can only access my index page all the other pages give me a 404 error
I want it on port 81 so in ports.conf I have added Listen 81
(No problems there but I'm going to give all the configs I have changed so you have some sort of overview)
Apache2.conf
Alias "/foo" "/var/www/foo
<Directory /var/www/foo>
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
AddHandler cgi-script .php
Require all granted
</Directory>
foo.conf
<VirtualHost *:81>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/team28
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
So the problem now is I can go to 192.168.1.101:81/foo which shows me my index but when I try to go to 192.168.1.101:81/foo/controller/index it gives me a 404 but 192.168.1.101:81/controller/index does give me the page I'm looking for...
I'm a bit puzzled as to what is going on, also not sure anymore what to google or how to find the answer I'm looking for.
I'm thinking it might have something to do with the rewrite module, no clue what though.
This is my htacces file in the foo directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Also when I run it locally on my machine with AMPPS I don't have any of there troubles.
server apache2 php
add a comment |
So I've got this weird problem, I am trying to host a php codeigniter project but I can only access my index page all the other pages give me a 404 error
I want it on port 81 so in ports.conf I have added Listen 81
(No problems there but I'm going to give all the configs I have changed so you have some sort of overview)
Apache2.conf
Alias "/foo" "/var/www/foo
<Directory /var/www/foo>
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
AddHandler cgi-script .php
Require all granted
</Directory>
foo.conf
<VirtualHost *:81>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/team28
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
So the problem now is I can go to 192.168.1.101:81/foo which shows me my index but when I try to go to 192.168.1.101:81/foo/controller/index it gives me a 404 but 192.168.1.101:81/controller/index does give me the page I'm looking for...
I'm a bit puzzled as to what is going on, also not sure anymore what to google or how to find the answer I'm looking for.
I'm thinking it might have something to do with the rewrite module, no clue what though.
This is my htacces file in the foo directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Also when I run it locally on my machine with AMPPS I don't have any of there troubles.
server apache2 php
add a comment |
So I've got this weird problem, I am trying to host a php codeigniter project but I can only access my index page all the other pages give me a 404 error
I want it on port 81 so in ports.conf I have added Listen 81
(No problems there but I'm going to give all the configs I have changed so you have some sort of overview)
Apache2.conf
Alias "/foo" "/var/www/foo
<Directory /var/www/foo>
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
AddHandler cgi-script .php
Require all granted
</Directory>
foo.conf
<VirtualHost *:81>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/team28
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
So the problem now is I can go to 192.168.1.101:81/foo which shows me my index but when I try to go to 192.168.1.101:81/foo/controller/index it gives me a 404 but 192.168.1.101:81/controller/index does give me the page I'm looking for...
I'm a bit puzzled as to what is going on, also not sure anymore what to google or how to find the answer I'm looking for.
I'm thinking it might have something to do with the rewrite module, no clue what though.
This is my htacces file in the foo directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Also when I run it locally on my machine with AMPPS I don't have any of there troubles.
server apache2 php
So I've got this weird problem, I am trying to host a php codeigniter project but I can only access my index page all the other pages give me a 404 error
I want it on port 81 so in ports.conf I have added Listen 81
(No problems there but I'm going to give all the configs I have changed so you have some sort of overview)
Apache2.conf
Alias "/foo" "/var/www/foo
<Directory /var/www/foo>
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
AddHandler cgi-script .php
Require all granted
</Directory>
foo.conf
<VirtualHost *:81>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/team28
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
So the problem now is I can go to 192.168.1.101:81/foo which shows me my index but when I try to go to 192.168.1.101:81/foo/controller/index it gives me a 404 but 192.168.1.101:81/controller/index does give me the page I'm looking for...
I'm a bit puzzled as to what is going on, also not sure anymore what to google or how to find the answer I'm looking for.
I'm thinking it might have something to do with the rewrite module, no clue what though.
This is my htacces file in the foo directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Also when I run it locally on my machine with AMPPS I don't have any of there troubles.
server apache2 php
server apache2 php
edited 2 days ago
fkraiem
9,01232031
9,01232031
asked 2 days ago
stilllearningstilllearning
115
115
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124033%2fproblems-with-apache-and-php-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124033%2fproblems-with-apache-and-php-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown