Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

htaccess rewrite rule

Posted on 2008-06-15
5
Medium Priority
?
200 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
[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
  • 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

636 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