• 10

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

htaccess with conditional rewritebase

I have a site (the-tack-shop.co.uk) in which I'm testing my e-commerce framework on. I was trying to test payment using a shared SSL: https://web43.secure-secure.co.uk/the-tack-shop.co.uk/.

I had to change my htaccess file to work with the SSL:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} secure-secure\. [NC]
RewriteBase /the-tack-shop.co.uk/
RewriteRule ^[a-z0-9\-_/\.]*$ index.php [L]

RewriteCond %{HTTP_HOST} the-tack-shop\. [NC]
RewriteBase /
RewriteRule ^[a-z0-9\-_/\.]*$ index.php [L]

RewriteRule ^.* http://www.google.com [L]

This will work with the SSL domain, but not with the normal domain. Comment out the second rewritebase and it will work on the normal domain but not on the SSL domain.

Can anybody please tell me where I am going wrong?

Apache is perfectly capable of doing what you are asking, however, the RewriteBase directive is not the prescribed way of achieving your desired results.

You have two options:

  1. Instead of using RewriteBase, just specify the base path in your RewriteRule declarations

  2. Create separate NameVirtualhost declarations instead of relying upon a catch-all

  • 1
Reply Report

Trending Tags