WAMP + directory alias + Drupal clean URLs - drupal

I have WAMP installed on my pc where I would like to run Drupal 6.
When I'm installing Drupal, I get the option to activate Clean URLs.
First I put my Drupal install in the www folder and I could choose to enable the clean URLs, but for backup reasons I moved it outside the www folder and created an alias the would point to the folder.
When I installed Drupal again, I couldn't choose to enable clean URLs anymore; the option was grayed out.
I would like to know why this happens; it seems some Apache module or PHP extension isn't available outside the www folder.
Just to be sure, I also tried an XAMPP install and created an alias with the some code lines as in the WAMP server but that worked, for some reason. The Apache version in WAMP isn't the same as the XAMPP install but I don't really think that is relevant.
I believe it's an config error in WAMP but I can't find out what.

Clean URLs doesn't work in the directory you copied Drupal because for that directory the directive AllowOverride is not set to All.
Drupal requires that every directives found in .htaccess files are enabled, in order to enable clean URLs; the directive AllowOverride, when set to All, allows to use all the directives that a .htaccess can contain.
The reason that in one case you can select the the option to enable the clean URLs, and in the other case is not selectable, is that Drupal, during its installation verifies the server is set to work with clean URLs, and change the form field to read-only if the server cannot support such feature.
To notice that the .htaccess file provided from Drupal can possibly need to be edited, in order to enable the clean URLs, as reported in the following comments, found inside the .htaccess file.
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

Related

Silverstripe install root folder public

I have installed silverstripe 4 into the /var/www/html folder in apache.
However, when I go to the url, I have to use "localhost/public/index.php" in order to obtain the main page. I thought I was to be able to just go to "localhost" to find the defaut page. What am I to do if I want to have a main page without people having to specify "/public/" before it?
Thanks.
Normally, your localhost website can be resolved without adding /public/ if the following 2 things are configured correctly.
Enable Apache mod_rewrite
Having .htaccess rewrite config in /var/www/html
Troubleshooting
Check if you got the right .htaccess in /var/www/html. Basically, this Apache config file will forward all the requests to /public/ folder.
If .htaccess is fine, make sure your mod_rewrite is enabled in your Apache. Check this link.

Wordpress Apache2 mod_speling not working

I am in the process of migrating my site to Wordpress from IIS.
I have run into an issue:
I have URL's that are a mix of upper and lower case that reference images. These URL's are getting a 404 because the case of the URL does not match the case of the file location.
For example, in my article I have a URL:
https://aaa.bbb.com/wp-content/migrate/ABC/abc.png
The file this is referencing is: /var/www/aaa/wp-content/migrate/abc/abc.png
When I change the URL to the same case as the file, it works, however how can I make it ignore the case of the folder on disk?
I tired the mod_speling module by putting this into /etc/apache2/apache2.conf but this just does not work for me. Also tried putting this into .htaccess in the root of my web directory but that made no difference.
<IfModule mod_speling.c>
CheckSpelling On
CheckCaseOnly On
</IfModule>
I have read various threads on here but I'm completely stuck.
I managed to find a work around to this.
I ended up writing a rewrite rule in the VirtualHost file to rewrite everything to lowercase apart from anything within the directory of assets imported from Windows.

loading Module mod_rewrite on httpd.conf file causes "Forbidden" error on localhost

Im on a mac running Sierra 10.12.2 and apache 2.4.23
I set up a localhost environment and a virtualhost for the domain cumsa.mx and installed wordpress on it. Without getting too into detail now, some changes were made on Git that modified the wp permalinks, and hence the .htaccess file through wp.
I went to my main httpd.conf file and told it to load the module mod_rewrite as suggested by a colleague since that was necessary to be able to modify the htaccess file. Regardless of that, activating this module results in my local environment for cumsa.mx to become "Forbidden".
Can anyone think of any idea why this wouldbe the case or which permissions I need to modify and how? Thanks!

Drupal Site Download : Not able to install site as-is

I recently downloaded a fully functional drupal(6) site using FTP. Though I installed the Drupal instance, I got the modules and the themes that were in the sites/all folder, but wasn't able to get the actual site configuration ( Configuration and Settings of those modules )
Any help in this regard would be greatly appreciated.
Assuming this is a follow-on of: Drupal Site install on localhost after downloading source using FTP
If you get the Drupal install screen when accessing a site you've just migrated to your localhost, it's likely because you're trying to access the site locally using a URI that's different than the remote site AND this URL does not fall within the directories that Drupal searches when looking for a settings.php file (see comments starting about line 20 in the default.settings.php file of the sites/default folder).
You have two options:
Option 1: Create a symbolic link on your localhost that points requests to your local URI to the directory hosting the live site. This would look something like this:
ln -s /path/to/webroot/sites/default/ /path/to/webroot/sites/mydevsite.dev
Option 2: Create a sites/sites.php file that maps URI's to the correct folder hosting your settings.php file. For example, you'd add this to sites/sites.php if you left your settings.php file in the sites/default folder:
$sites['mysite.dev'] = 'default';
$sites['www.mysite.dev'] = 'default';
$sites['mysite.com'] = 'default';
$sites['www.mysite.com'] = 'default';
Simply put, this translates into: "Serve sites mysite.dev, www.mysite.dev, mysite.com, and www.mysite.com from the folder located at sites/default."
I usually use the second option. It's more sustainable, OS independent, and can be committed to source control.
Update based first 5 comments:
You need to edit the .htaccess file in your Drupal install. Look for this section:
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
And do as it says, uncomment out the line and set it to your subdirectory.
Yes the steps are correct. Is it the design that is not coming or is the functionality of views missing? If its only the css that is not coming, then the issue could be that your theme is not getting applied. Check if the theme folder correctly exists, and disable/enable the theme.

Migrating Drupal

Currently I have a single drupal site installed on apache 2.2 with php 5.3 on RHEL 6. I am moving servers and am trying to migrate the site. I have imported the database and htaccess, but I cannot access any of the pages other than the root of the site.
You may need to disable clean URLs before exporting the database, try to add ?q= before each path.
That happens when:
a) Apache mod_rewrite is not enabled. If you have root access then do sudo a2enmod rewrite
or
b) .htaccess file at the root folder isn't there, so you need to copy it again.
Here's a troubleshoot check list for mod_rewrite issues:
Make sure Apache's rewrite module is enabled: sudo a2enmod rewrite.
Make sure original .htaccess file is there in the root of your Drupal installation.
Make sure that the existing .htaccess file is getting read by Apache. To test it, add a this line in the beginning of the file and you should get a 500 Internal Server Error: ThisIsReallyABadSyntax.
If the .htaccess file is not in effect, make sure that the AllowOverride directive in the main Apache config file (usually /etc/apache2/httpd.conf on debian-based distros) is set to All. It might be set to None by default.
Finally, make sure that the clean URLs feature is enabled in Drupal settings.
With the phpinfo(); compare all the server specs, just to be sure both server are quite the same or similar.
Steps to migrate Drupal correctly:
Go to Configuration
find Clean URLs
Disable tick inside!
Clean cache!
Download your site file
Download your database
Create new database in your new site
Transfer file and database
Log in
10.Do this step to enable Clean URLs:
It's work 100% guaranteed !
Steps:
1. Download - Dev version (7.x-dev)
2. Find file .htaccess
3. just copy it to your server
4. That's it !

Resources