Solved

Using mod_rewrite when site is on subdomain

Posted on 2004-08-18
3
162 Views
Last Modified: 2010-03-04
Hi, I'm trying to use mod_rewrite to produce clean URI's, but the page won't load after I make the required changes to the .htaccess file.

I'm setting up a photo site on a subdomain of my main site, and I think I may need a different value for RewriteBase (instead of a subfolder) because of that.  Hoping someone can point me in the right direction.  Thanks!


Code:

RewriteEngine on
RewriteBase /subfolder/

RewriteRule    ^(.*)/(.*)?/?$    index.php?a=$1&i=$2   [QSA]
RewriteRule    ^(.*)?/?$    index.php?a=$1   [QSA]
0
Comment
Question by:Kyle93816
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11845022
did you miss the  RewriteCond ?
0
 

Author Comment

by:Kyle93816
ID: 11845917
I'm not sure.  I don't know what that means.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 11849843
# assuming that your given URL is not index.php, then prepend your rewriteRule by:

RewriteCond %{REQUEST_URI} !index.php
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question