Solved

htaccess rewrite rule

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IPv6 Networking 6 101
Trying to connect the LDAP over SSL 38 281
How to find /read Apache log error file ? 5 123
Apache/PHP: Cannot make phpinfo() and phpmyadmin work 4 49
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…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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