WebFaction
Community site: login faq

Hi,

For all my applications I use the following mod_rewrite code in my .htaccess file:

Options +FollowSymLinks All
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?page=$1 [NC,L]

But now when I access any of my applications, it throws a 404 with this path not being found (it does exist): /home/saveas/webapps/htdocs/app_name/index.php

Since today everything suddenly stopped working. When I add a RewriteBase / line, every page is redirected to one of my hosted websites.

Thanks in advance

asked 14 Feb '12, 06:06

Saveas
535
accept rate: 0%

edited 14 Feb '12, 06:06


Hi,

The path does exist, but it's a system path, and it is supposed to be an URL path in this case.

You should add "Rewritebase /app_name/" instead of "Rewritebase /" - this should fix the problem.

If you still experience problems after adding this line to your .htaccess, please open a ticket so we can take a closer look at your apps.

permanent link

answered 14 Feb '12, 06:31

todork
1.2k4
accept rate: 34%

That does work but I prefer to keep my .htaccess files identical between applications and it used to work. Isn't there another solution that doesn't require placing the folder name in the RewriteBase value?

(14 Feb '12, 13:25) Saveas

Three days ago your server had a kernel security update applied. Other system-wide packages are updated regularly whenever security patches are released as well. This should never affect defined behavior, but if your application happened to be unintentionally relying on some software idiosyncrasy, then simply the bug that allowed this in a corner case could have been fixed. If you did indeed make no changes to the application and it stopped working out-of-the-blue, then this is the most likely explanation.

(15 Feb '12, 01:44) ryans ♦♦

Hi, just want to say thanks, I have been the last 3 hours trying to find a solution for a similar problem and I just solved using or adding the rule: RewriteBase /directory/ below RewriteEngine On

What I don't understand is why suddenly the Rewrite rule stopped working, it had been working without the RewriteBase /directory/ rule for the last 3 years with no code changes. Weird.

THANKS Anyway.!

permanent link

answered 29 Jan '13, 07:50

Autopten
11
accept rate: 0%

edited 29 Jan '13, 07:53

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×73
×13

question asked: 14 Feb '12, 06:06

question was seen: 3,450 times

last updated: 29 Jan '13, 07:53

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM