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

x
?
Solved

Apache rewrite rule

Posted on 2011-02-20
1
Medium Priority
?
395 Views
Last Modified: 2012-06-22

I am attempting to rewrite http://mysite.com/123456/Insert-Anything-Here 
to
http://mysite.com/page.cfm?page=123456

But only in instances in which what follows http://mysite.com/ is a number, and only in cases in which that number is followed by: /and-something-alpha-numeric-here

I have other rewrite rules that are working, so my presumption is that the issue is not the environment.

Below is what I have that isn't working:

RewriteRule ^/[(0-9+)]/(.*)$ /page.cfm?page=$1 [NC]

Open in new window

0
Comment
Question by:mrjljohnson
[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
1 Comment
 
LVL 16

Accepted Solution

by:
sjklein42 earned 2000 total points
ID: 34938673
Sliight prob with your parens.  They belong outside the [0-9]+ thing.

RewriteRule ^/([0-9]+)/(.*)$ /page.cfm?page=$1 [NC]

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month11 days, 7 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