Solved

Using mod_rewrite when site is on subdomain

Posted on 2004-08-18
3
159 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
  • 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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