?
Solved

htaccess rewrite rule

Posted on 2008-06-15
5
Medium Priority
?
202 Views
Last Modified: 2010-03-04
I would like my site's users to type

http://www.mysite.com/program/277/

and get:

http://www.mysite.com/index.php?page=program_details&calID=277&semID=0

I posted this before, but wasn't able to get it working.
0
Comment
Question by:gianchi66
  • 4
5 Comments
 
LVL 19

Expert Comment

by:bevhost
ID: 21789968
You .htaccess should contain

<IfModule mod_rewrite.c>
RewriteEngine On
ReWriteRule ^program/(.*)$ index.php?page=program_details&CalId=$1&semID=0
</IfModule>

In you apache setup you need
      <Directory />
        AllowOverride All
      </Directory>
0
 

Author Comment

by:gianchi66
ID: 21790241
Thank you. But it doesn't work.

Can I send you the actual site link (I don't want to make it public here.)?
0
 
LVL 19

Expert Comment

by:bevhost
ID: 21790683
I'm not sure how giving me the url would help anyway.
Do you have this in you apache config?

LoadModule rewrite_module modules/mod_rewrite.so
0
 
LVL 19

Expert Comment

by:bevhost
ID: 21790691
Does http://www.mysite.com/program/277 work
it looks like I missed the traliing slash in the .htaccess
should be
ReWriteRule ^program/(.*)/$ index.php?page=program_details&CalId=$1&semID=0
0
 
LVL 19

Accepted Solution

by:
bevhost earned 1000 total points
ID: 21790694
or maybe you want this...
ReWriteRule ^program/(.*)/(.*)$ index.php?page=program_details&CalId=$1&semID=$2
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month17 days, left to enroll

864 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