?
Solved

How to tell Apache to ignore a certain part of an SEO friendly URL, but include the rest

Posted on 2008-10-18
2
Medium Priority
?
246 Views
Last Modified: 2012-05-05
I'm using SEO friendly URLs throughout a client site. The RewriteRule function is being used to do this, as follows:

RewriteRule ^index/(.*)/ index.php?p=$1
RewriteRule ^index/(.*)/(.*)/ index.php?p=$1&q=$2

I want to write some URLs for a forum topic page, as follows:

/index/thread/this-is-the-topic-title-1/

Basically the only thing I want being passed to the PHP query is the number (this is the Thread ID), the text "this-is-the-topic-title-" needs to be ignored, but I don't know how to do that.

Any ideas?

Thanks in advance.
0
Comment
Question by:DReade83
[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
2 Comments
 
LVL 2

Accepted Solution

by:
diaF earned 2000 total points
ID: 22747829
try

RewriteRule ^index/(.*)/.*-([0-9]*)/ index.php?p=$1&q=$2
0
 

Author Closing Comment

by:DReade83
ID: 31507396
Thank you very much - that worked a treat. :-)
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

719 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