Adding .htaccess to Cordova - .htaccess

I'd like to add a .htaccess to rewrite all paths to relative ones within Cordova.
At default, the .htaccess seems to be ignored. For Apache servers, you have to activate the support of these files.
Is there any equivalent option for Cordova, that works with every platform?

Related

Why don't my clean URL's work in Drupal, even though rewrite_module is present?

Hey guys. I'm asking this question here as a last resort, since I've been trying to solve the issue for almost two days now.
I'm trying to enable clean URL's on my Drupal web application. I have visited several public questions such as this one, but to no avail. My sincerest apologies if this is thus a repost.
Some (relevant) context:
The project involves automatically setting up a VM using a Vagrant script.
The VM has no GUI.
Vagrant uses VirtualBox.
Vagrant uses bento/centos-7.9 as a base box.
I use WSL on my physical device whenever I need a terminal for PS or Linux commands.
I'm setting up a LAMP stack on the VM using the following:
CentOS 7.9, as mentioned up above.
Apache 2.4.6, as in:
yum -y install httpd
MariaDB 10.5.9, as in:
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
./mariadb_repo_setup
yum -y install mariadb-server
PHP 7.4.16, as in:
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php74
yum -y install php php-mysql
I'm storing the extracted contents of Drupal (index.php, update.php,
core, sites ...) under /var/www/drupal/. I have given Apache
recursive ownership of that folder as to not create a hassle having to set up permissions. It's not a production project anyway.
In the /etc/httpd/conf/httpd.conf file, I have only touched the
DocumentRoot, which I set to DocumentRoot "/var/www/drupal". I do not want to use .htaccess.
When I run httpd -M | grep rewrite, I receive the output rewrite_module (shared). When I run phpinfo(); on a test page, mod_rewrite is present among the loaded modules.
Running the application, everything goes fine, and the following output is produced:
Drupal warnings top part
Drupal warnings bottom part
I'm aware of the other two warnings, but those are a worry for another day. When I continue despite the warnings, Apache loads index.php just fine:
Screenshot of index.php
However, the moment I click any button, this happens:
Screenshot of yet another problem
I suspect this is a consequence of the clean URL's not being enabled. However, as far as I know, all necessary modules have been installed.
What I have tried so far:
In /etc/httpd/conf/httpd.conf, trying everything that's suggested here.
In /etc/httpd/conf/httpd.conf, setting every AllowOverride option to All.
Checking for compability issues.
Moving the document root around.
Much more...
Help would be greatly appreciated. Many thanks in advance. If you require any more information, I will respond as soon as possible.
Hey guys. The issue has been solved.
Somehow, it suddenly works. I am now able to navigate the website without a Not Found error popping up.
I retried a method that didn't work before, but now it does. There was no change in any other variables. I edited /etc/httpd/conf/httpd.conf. Besides already having changed DocumentRoot to /var/www/drupal, I also added another piece of configuration right under that:
<Directory "/var/www/drupal">
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
</Directory>
I obtained this information from here.
The CLEAN URLS warning is still present though:
Drupal warnings top part
But there seems to be no problem when continuing despite the warnings. In fact, in the application itself, navigating to the errors/warnings section, the CLEAN URLS warning isn't even there!

Magento Installation Without .htaccess

I'm making a new Magento Installation and like always, access magento.com to download the installations files.
For my surprise, theres no more .htaccess in the compress files O.o
Someone can tell why or give any tip?
It is always there, but it's a hidden file so just change the setting of the Files Manager or Finder to see it.

CakePHP htaccess files on 1und1 webserver

I'm trying to install my cakephp webapp on an 1und1 (German version of 1and1) webspace.
PHP and MySQL are installed and there seems to be a problem with my htaccess files as I can't open the css files for example on the webspace (404).
How does my .htaccess files have to look like?
The application is not installed in the root directory (that's unfortunately not possible), it's located under:
http://www.mysite.de/myfolder/system
http://www.mysite.de/myfolder/system/app
http://www.mysite.de/myfolder/system/app/webroot
I tried a lot of combinations. But none are working.
The last example I tried were the answers from this question: how to configure htaccess file for Cake 2.3.x on 1and1 shared hosting
Any recommondations?
Using the built in method for url-rewriting solved my problem: http://book.cakephp.org/2.0/en/development/configuration.html#core-configuration-baseurl

Install modx in a subfolder

I like my webspace tidy :)
Therefore if my root-folder is html/ I would like to install modx (version 2.2) in the subdirectory html/modx/
For my website-visitors everything should be the same as if I would have installed modx in the root folder (html/).
I also don't want to do without friendly urls.
To make it even more difficult: I also really like the builtin modx file browser and I would love to use it for every file and folder in the document root (so every file inside html/* should be displayed).
(How) is this possible?
Additional question: if it is possible, is it better to reinstall modx in the subfolder or to move my installation to the new location (html/modx). As my installation is only a few days old, either option would be fine.
What version of MODx are you using?
Usually you would do an advanced installation (a separate version of MODx). You can move the existing MODx install to your sub-directory but you will need to update all of the config.core.php files and MODX_CORE_PATH constants to reflect this. You will also need to leave and update at least the index.php file in your web root directory. The config files that would need updating include:
config.inc.php
manager/config.inc.php
connectors/config.inc.php
core/config/config.inc.php
core/config/config.inc.php is the most important file and you will want to make sure ALL of the paths listed in there are correct.
The file browser will work fine providing you check all the URL and filesystem paths are correct in the Manager settings.
Change your .htaccess setting:
RewriteBase /subfoldername/
and install it as typically you do.

Edit php.ini with .htaccess

I'm slowly getting back into PHP, and now I run into a problem, I want to install some web software on our host and I need to have either the latest Zend (which they don't have) or IonCube on the server and IonCube requires enable_dl to be on in the php.ini. Now a colleague of mine thinks I can update this via an .htaccess file on the server. So I created a s.htaccess on my machine as Windows doesn't like emptiness before the file extension. So I added the line php_flag enable_dl On to the file uploaded it and renamed the file to just .htaccess on the server. When I refresh the file is gone, when I keep it as s.htaccess it's fine but my php info still shows it as Off.
What n00b mistake am I making?
The documentation says that this can only be set in the php.ini (not in .htaccess). You can see this by looking at the table where it says "PHP_INI_SYSTEM", which means - "Entry can be set in php.ini or httpd.conf".
Unix way to hide files is prepending it with a dot. The file is there, but it's just hidden. Your ftp-software should have a setting for showing hidden files. IIRC you can rename the file to .htaccess through cmd in windows. The .htaccess only has effect in the current dir and sub directories. This might also be (because of security) one of those settings that is only setable through php.ini

Resources