Solved

Apache rewrite rule

Posted on 2011-02-20
1
382 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apache server crashes randomly 38 113
tomcat7  URL keeps resolving to https instead of HTTP 4 61
Apache timeout remote connection if not port 80 10 84
wamp versus xampp 4 62
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…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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