Solved

Apache rewrite rule

Posted on 2011-02-20
1
380 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
1 Comment
 
LVL 16

Accepted Solution

by:
sjklein42 earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

13 Experts available now in Live!

Get 1:1 Help Now