Solved

htaccess rewrite rule

Posted on 2008-06-15
5
190 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

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…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 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

17 Experts available now in Live!

Get 1:1 Help Now