1439: URL /r/xyz always redirects to /xyz

yousse*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Oct. 8, 2010
What version are you running?
1.1 alpha 2

What's the URL of the page containing the problem?
/r/(anything)
This would be the same for /r/34 (to display a review) or /r/new or
anything under /r

What steps will reproduce the problem?
1. From the dashboard (or any page), click any review
2. From the dashboard (or any page), click "New Review Request"

What is the expected output? What do you see instead?
Expected output is the review or the new review request page. Instead, I
get a 404 as here is what happens:
http://reviewboard.example.com/r/34 would redirect to
http://reviewboard.example.com/34

or 
http://reviewboard.example.com/r/new would redirect to
http://reviewboard.example.com/new would redirect to

What operating system are you using? What browser?
OS: CentOS 5.4
Browser: Linux Chrome, Firefox 3.5, and Opera 10.

Please provide any additional information below.
It seems to me that the get_absolute_url call in /review/models.py is
returning the url without the /r piece of it.

Regards,
Youssef
chipx86
#1 chipx86
Sounds like a configuration issue. Please attach your Apache configuration file and
your conf/settings_local.py file. Do obfuscate account information and the SECRET_KEY
in the settings_local.py file though.
  • +NeedInfo
  • -Type-Defect
    +Type-Support
#2 yousse*******@gmai***** (Google Code) (Is this you? Claim this profile.)
reviewboard.example.com.conf
---------------------------
<VirtualHost *:443>
	ServerName reviewboard.example.com
	DocumentRoot "/var/www/reviewboard.example.com/htdocs"
	LoadModule python_module /usr/lib64/httpd/modules/mod_python.so
	# AddModule mod_python.c

	# Error handlers
	ErrorDocument 500 /errordocs/500.html

	# Serve django pages
	<Location "/">
		PythonPath "['/var/www/reviewboard.example.com/conf'] + sys.path"
		SetEnv DJANGO_SETTINGS_MODULE reviewboard.settings
		SetEnv PYTHON_EGG_CACHE "/var/www/reviewboard.example.com/tmp/egg_cache"
		SetHandler mod_python
		PythonHandler django.core.handlers.modpython
		PythonAutoReload Off
		# PythonDebug On
		# Used to run multiple mod_python sites in the same apache
		PythonInterpreter reviewboard_reviewboard_example_com
	</Location>

	# Serve static media without running it through mod_python
	# (overrides the above)
	<Location "/media">
		SetHandler None
	</Location>
	<Location "/errordocs">
		SetHandler None
	</Location>

	<Directory "/var/www/reviewboard.example.com/htdocs">
		AllowOverride All
	</Directory>

	# Alias static media requests to filesystem
	Alias /media "/var/www/reviewboard.example.com/htdocs/media"
	Alias /errordocs "/var/www/reviewboard.example.com/htdocs/errordocs"
</VirtualHost>

<VirtualHost *:80>
     ServerName reviewboard.example.com
     DocumentRoot /var/www/html/

     <Directory /var/www/html/>
          Options Indexes ExecCGI FollowSymLinks
          AllowOverride all
          Order allow,deny
          Allow from all
     </Directory>

    # By default, we send everyone to SSL..
    
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>


settings_local.py
-----------------
# Site-specific configuration settings for Review Board
# Definitions of these settings can be found at
# http://docs.djangoproject.com/en/dev/ref/settings/

# Database configuration
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'xxx'
DATABASE_USER = 'xxx'
DATABASE_PASSWORD = 'xxx'
DATABASE_HOST = 'xxx'
DATABASE_PORT = ''

# Unique secret key. Don't share this with anybody.
SECRET_KEY = 'xxxxxx'

# Cache backend.  Unset this to turn off caching completely.  As with most
# django installations, the best option is probably to use memcached.
CACHE_BACKEND = 'memcached://localhost:11211/'

# Local time zone for this installation. All choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-
TABLE
TIME_ZONE = 'Africa/Cairo'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

# Extra site information.
SITE_ID = 1
# Set this to the place of your reviewboard if it does not reside
# at the root of your server. - Add the trailing slash.
#SITE_ROOT = '/'
#FORCE_SCRIPT_NAME = '/'
DEBUG = True

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
#USE_I18N = False

# TLS for LDAP.  If you're using LDAP authentication and your LDAP server
# doesn't support ldaps://, you can enable start-TLS with this.
LDAP_TLS = False

# Cache backend settings.
CACHE_BACKEND = 'memcached://localhost:11211/'


# Access method used for the site, used in e-mails.  Override this in
# settings_local.py if you choose to use https instead of http.
DOMAIN_METHOD = "https"

# Require a login for accessing any part of the site. If False, review
# requests, diffs, lists of review requests, etc. will be accessible without
# a login.
REQUIRE_SITEWIDE_LOGIN = True
david
#3 david
  • -NeedInfo
    +New
david
#4 david
Did you ever get this working? My web searches only seem to indicate that you might need to add [R,L] at the end of your RewriteRule.
  • -New
    +NeedInfo
  • +Component-Deployment
david
#5 david
  • -NeedInfo
    +Incomplete