I consider myself to be a burgeoning novice and have followed all the instructions provided on the module page in order to install and get AIS to work properly on my site running in a local environment. However, immediately after running the command patch < sites/all/modules/ais/ais.htacess.patch my site was almost completely shut down. I can still view the homepage but clicking anywhere else results in the message: "The requested URL/index.php was not found on this server." Now, I figured this might have something to do with the note at the bottom of the instructions concerning the RewriteBase settings. So I located the htaccess file manually (might be nice to explain to those less knowledgeable that htaccess is a hidden file and must also be accessed via the terminal by going to the drupal root folder and entering the command sudo nano .htaccess) and I did need to uncomment "RewriteBase /" (you save the file by pressing control-o and exit the document with control-x). I also made sure that the patch was inserted in the correct area of the htaccess file but none of this did anything for my problem. What am I missing here? I'm going to try undoing all of this because its freaking me out but I am curious to know why this is happening.

Comments

spotzero’s picture

It sounds like the RewriteBase isn't set correctly.

It should be set to the directory containing your Drupal instance.

So if your site is available from:
http://example.com/

The RewriteBase should be:
RewriteBase /

If you site is available from:
http://example.com/exampledir/

The RewriteBase will be:
RewriteBase /exampledir/

Let me know if this fixes your problem.

Thanks,

tchopshop’s picture

This happened to me too. I was running the site in a localhost instance. So my URL was localhost:8888/mysitename.
Correcting the .htaccess to:

RewriteBase /exampledir/
fixed the problem.

Thank you!

spotzero’s picture

Component: Documentation » User interface
Assigned: Unassigned » spotzero
Category: task » feature
Status: Active » Needs work

Currently, if the RewriteBase is mis-configured, AIS report's it on the Status Report page. Since few contrib modules use this page, it's not somewhere people check when troubleshooting.

I'll make the warnings that show up when AIS is mis-configured be displayed in a more visible place.

racl101’s picture

Assigned: spotzero » racl101

Thanks this really helped.

astanley86’s picture

I've contacted my web host and confirmed that I'm using the right RewriteBase but I get these two errors in Drupal's Status Report:

Adaptive Image Styles
Couldn't find the AIS htaccess rules in the htaccess file. Without these rules, AIS will not work.
Error
Adaptive Image Styles
RewriteBase appears to be configured incorrectly in the .htaccess file. The RewriteBase is set to '/', but should be '/index.php'.

They changed:

RewriteCond %{HTTP_COOKIE} ais=([a-z0-9-_]+)

to:
RewriteCond %{HTTP_COOKIE} ais=(.+)

Any ideas as to why AIS does not like my .htaccess file?

spotzero’s picture

The htaccess rule checker in AIS does a string search to find its rules in the htaccess file, so there are lots of stituations where AIS works, but the htaccess rule checker will complain.

For example, if you change the rules from the default to equivalent rules or if you include the rules in the Apache configuration instead of the htaccesss, AIS will work, but not the checks will not be able to be done sucessfully.

Unless it's causing problems, it's safe to ignore those errors.

astanley86’s picture

Yes, AIS is indeed working correctly despite seeing these errors. Thank you.

spotzero’s picture

Please note

The line "RewriteCond %{HTTP_COOKIE} ais=(.+)" should not be used instead of the line "RewriteCond %{HTTP_COOKIE} ais=([a-z0-9-_]+)".

See http://drupal.org/node/1784086 for details.

spotzero’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Fixed grammatical error.

anurag.s’s picture

Issue summary: View changes

Thanks a lot ! It helped.

yonibb’s picture