troubleshooting Question

.htaccess - help needed with RewriteRule

Avatar of sabecs
sabecs asked on
Apache Web Server
6 Comments1 Solution421 ViewsLast Modified:
I have some rewrite rules which cause links such as <a href="Coaches">Coaches</a> to redirect to a specific page which works fine, but if I have a link to a file that contains the same name then it will also redirect.

How should "RewriteRule Coaches index.php?page_id=262" be written to work for the first link but not the other?

Thanks in advance for your feedback.

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$ [NC]
RewriteRule ^(.*)$$1 [L,R=301]
RewriteRule ([0-9]+)(.*)\.html$ index.php?page_id=$1

RewriteRule Home\ Page index.php?page_id=1
RewriteRule Club\ Details index.php?page_id=14
RewriteRule Coaches index.php?page_id=262
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros