Enabling clean URLs (Drupal 7) in .htaccess on Debian - content-management-system

I am having a complicated issue, which I can't figure out. There is a solution to this matter by modifying the 000-default file in /etc/apache2/sites-enabled.
The AllOverride line must be left with the following keyword None.
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Is there any other way to enable clean URLs on a Debian server for Drupal 7?

Open your .htaccess file in your project root.
Uncomment RewriteBase /drupal and change it to your project name like RewriteBase /myprojectname .
Comment RewriteBase /
Goto /admin/config/search/clean-urls
There will be an option to Enable clean URLs .

Related

Flutter web 404 without hash on apache no htaccess

I'm trying to enable direct url handling on my Flutter app. I am using beamer and the app works as expected with deep linking within an app emulator, and when using the chrome web browser emulator through vscode.
When I publish the code though, only the main page works. Directly accessing the url doesn't.
When I switch back to the /#/ strategy, everything works and I can access anywhere in the app directly.
This means that the app is not loaded and only the Apache webserver is returning a 404 because it does not recognize index.html of the flutter jS file to be a cgi.
Awhile back I worked with php and there was a way to access url's without using extensions and an override in httpd.conf setting.
Has anyone got this working for flutter navigation 2.0 compiled for web on an apache webserver?
Thanks
create a .htaccess file in the root directory:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [L]
</IfModule>
Edit httpd.conf for that root directory:
DocumentRoot "/Users/myname/myapp/build/web"
<Directory "/Users/myname/myapp/build/web">
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
Visit: yoursite.com/path/to/flutter/page or wherever you have a route parser

Magento 2 moving Apache docroot to pub directory

I've recently performed a Magento security scan and it recommended I move the root of my Magento 2 installation to the pub directory.
I've followed the instructions here but I've had no success. The site fails to find the images and merged CSS files. I have double checked that the CSS files and images exist in their respective directories in pub/static.
My Apache configuration:
DocumentRoot /var/www/html/magento2/pub
ServerName www.somedomainorother.co.uk
ServerAlias somedomainorother.co.uk
<Directory "/var/www/html/magento2/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
I am using Apache 2.4, Centos 7.3.
Has anybody run across a problem like this before and how did you fix it?
I had exactly the same issue and the root cause I found that Magento was still looking for the static resources under [site_url]/pub/static or (if static versioning is enabled):
[site_url]/version[NNNNNN]/pub/static
While they should have been requested according to the new root
[site_url]/version[NNNNNN]/static
I had to check the static and media urls, in core_config_data I found [site_url]/pub/media and [site_url]/pub/static as values for base_media_url, base_static_url for secure and unsecure. I simply removed these config records from core_config_data and left the application to retrieve them correctly by default.
I assume you have tried the usual trick of:
php bin/magento setup:static-content:deploy
You may need to add an '-f' after depending on which mode you are in. Also, if you are using a language different to 'en_US' then you woul dneed to add that at the end. I have to do this:
php bin/magento setup:static-content:deploy -f en_GB
This has helped me get out of those CSS and image screw ups.
Otherwise I would look at maybe it being a permissions issue?

Cannot open admin panel of magento 2

After migrating the magento 2 project from localhost to live server, th frontend works fine but cannot open backend(AdminPanel) of magento.
Please Help,
Thanx in advc
Please change Allowoverride none to Allowoverride All in httpd.conf file of your live server.
Enable mod_rewrite on Apache
Clear magento cache
Check URL entries in core_config_data table(for magento2.1)

Sling Dynamic Include with Dispatcher

I was looking over the blog here to understand the concept of SDI+Dispatcher. I enable SSI on apache via using this post & seems it working. But didn't get any material which can demonstrate this concept practically. I am using the same geomatrixx page to where some user logged in and gets cache. How can i store the only static part on the dispatcher cache and how the dynamic component will render at run time. I made changes to my apache conf file as below but now looking over further steps. In blog its also mention to add <!--#include virtual="/includes/header.html" --> so where so i need to add this under body.jsp of page component or somewhere on apache server.
LoadModule dispatcher_module /usr/lib/apache2/modules/dispatcher-apache2.4-4.1.8.so
<IfModule disp_apache2.c>
<!-- Configurations -->
</IfModule>
SetOutputFilter INCLUDES
<Directory />
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
Options FollowSymLinks Includes
AllowOverride None
</Directory>
AND
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride None
Require all granted
</Directory>
Thanks
Sling Dynamic Include automatically replaces components enumerated in the OSGi configuration with the SSI include tag (<!--#include...), so you don't have to write this tag in any JSP.
Open the Apache Felix console, go to the OSGi / Configuration tab and create a new SDI Configuration entry. More information on the configuration properties can be found on the Github. Enter resource types of the components and from this moment (assuming that the dispatcher configuration is OK) they will be replaced with SSI include tags and - as a result - served dynamically even if the whole page is cached.
Aforementioned Github repository contains the most up-to-date documentation of the module.

How to set DocumentRoot in httpd.conf to windows environment variable

First I want to say thanks to community for all the answers I've found here in the past. I'd like to set the DocumentRoot line in the http.conf file to the current windows user's dropbox folder. I thought you could do it by doing something like...
DocumentRoot "C:/Users/${USERNAME}/Dropbox/"
&
but that isn't working. Is there a way to set config files to Windows environment variables?