centos wordpress the requested URL was not found on this server, - php

I am trying to host my wordpress project in centos remotely, i have hosted it on /var/www/html and gave permission 777 for all sub folders and files, and changes
and in .httpd file i have changed to all
<Directory />
AllowOverride All
# Require all denied
</Directory>
and
<Directory "/var/www">
AllowOverride All
# Allow open access:
# Require all granted
</Directory>
also in
<Directory "/var/www/html">
AllowOverride All
</Directory>
have changed
<Directory "/var/www/cgi-bin">
AllowOverride All
Options None
Require all granted
</Directory>
but not use the i am getting same internal server error, and The requested URL /l was not found on this server, but i can able to access backend of wordpress wp-admin what would be the problem then?

Adding this in .htaccess solved the problem
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

I think the best way is check apache error log.

Related

Update .htaccess to reduce length of URL

I am sending a website live and I was getting a 500 internal Error.
So I have googled around and I have been able to find a solution.
I have added modifications to the code below.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/public/index.php
RewriteRule ^(.*)$ /public/index.php/$1 [L]
</IfModule>
The issue is that, when I enter an URL such as www.app.com, I obtain www.app.com/public/index.php
Is there a way to update the .htaccess so that requests made to www.app.com will be redirected to www.app.com/public/index.php without showing /public/index.php in the URL?
Try modifying /etc/apache2/sites-available/default (default location on most Linux distributions, yours may be different).
Change AllowOverride None to AllowOverride All so you should have:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www>
Options FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
Then restart apache with systemctl restart apache2.

Phabricator install. Rewrite rules are not configured correctly

I've followed the Phabricator Configuration Guide, and after installing all dependencies, I'm facing the following message:
Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.
This message is shown when I try to access www.cleverbit.com.br/phabricator/webroot/
I have a apache2.conf file configured just the way the docs suggested:
<VirtualHost *>
# Change this to the domain which points to your host.
ServerName cleverbit.com.br
# Change this to the path where you put 'phabricator' when you checked it
# out from GitHub when following the Installation Guide.
#
# Make sure you include "/webroot" at the end!
DocumentRoot /var/www/html/phabricator/webroot
RewriteEngine on
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
</VirtualHost>
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/html/phabricator/webroot">
Require all granted
AllowOverride All
</Directory>
What's exactly wrong with my apache rewrite configuration?
Apache does not have inheritance inside Directory statements, so you also need the AllowOverride All line inside the Directory block for /var/www/html/phabricator/webroot.
To avoid confusion, I would get rid of the /var/www Directory block, unless you have another VirtualHost that uses it (in which case, you might want to move Phabricator out from that directory to avoid accidentally creating back doors).
Setting the following rewrite rules fixed this for me
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
thanks to https://gist.github.com/sparrc/b4eff48a3e7af8411fc1

Access forbidden Xampp Mac osx using yii2

I get the following error:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
when I use the following code in my httpd-vhosts.conf:
<VirtualHost *:80>
ServerName frontend.dev
DocumentRoot "AmanAgarwal/Projects/basic/yii-application/frontend/web/"
<Directory "AmanAgarwal/Projects/basic/yii-application/frontend/web/">
# use mod_rewrite for pretty URL support
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
# use index.php as index file
DirectoryIndex index.php
# ...other settings...
# Apache 2.4
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
## Apache 2.2
</Directory>
</VirtualHost>

CodeIgniter htaccess issue at AWS server

This is the first time using CodeIngiter and I have url access issue.
I have to include index.php in the url to access a page.
To solve the issue, I took a reference at here.
I followed all steps.
I have updated at config.php as
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/Your Ci folder_name';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
.htaccess file at root is
RewriteEngine On
RewriteCond $1 !^(index\.php | assets | images | js | css | uploads | favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php/$1 [L]
ubuntu#ip-172-31-28-229:/var/www/html/CodeIgniter$ a2enmod rewrite
Module rewrite already enabled
I can't change all AllowOverride None to AllowOverride All. in the /etc/apache2/apache2.conf file. If I do it, I even can't access my root url.
My /etc/apache2/apache2.conf file is as follow.
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
I restarted my apache2 server.
But I still can't access without index.php in my url.
What is still wrong?
My problem was solved using the following mod_rewrite.c:
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymlinks
# - - - Use for 1and1 - - -
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

.htaccess not working for redirect subfolder to apache root

I'm on Debian 8 and I have a website in http://my-domain.unice.fr/social and I want to redirect this on http://my-domain.unice./
In my .htaccess I have :
RewriteEngine On
RewriteRule ^social/(.*)$ /$1 [R=301,NC,L]
and in my apache2.conf :
</Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
But when I going to my domain, I have the list of my file/folder in my root directory ... and not my website.
What I forgot in my config ?
Thanks you
I found a spelling mistakeļ¼š
wrong: AllowOvveride All
correct: AllowOverride All

Categories