Solved

htaccess rewrite rule

Posted on 2008-06-15
5
189 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 250 total points
ID: 21790694
or maybe you want this...
ReWriteRule ^program/(.*)/(.*)$ index.php?page=program_details&CalId=$1&semID=$2
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now