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

x
?
Solved

need some help with rewrite rule

Posted on 2011-02-15
7
Medium Priority
?
375 Views
Last Modified: 2012-06-27
Hi

I need some help with configuring the right conditions for rewrite rule.
Current status:
Options +FollowSymlinks
RewriteEngine on

rewritecond %{http_host} ^gurushots.com [nc]
rewriterule ^(.*)$ http://www.gurushots.com/$1 [r=301,nc]

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^index\.php$ "http\:\/\/www\.gurushots\.com" [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^pro-p/([a-zA-Z0-9_-]+)/?$ /pro-profile.php?n=$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)/?$ /pro-full-profile.php?n=$1

I would like to add to more rules:
our website is providing professional photo critique.
1. I need to add category rule :  www.site.com/photo-critique/category-name/
these should point to photo-critique-categories.php?n=category-name
2. and also point to specific critique: www.site.com/photo-critique/category-name/critique-name
these should point to photo-critique-by-name.php?n=critique-name

thank you
0
Comment
Question by:eranhazout
[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
  • 4
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
_-MYFOX-_ earned 2000 total points
ID: 34895724
RewriteRule ^/photo-critique/([A-Za-z0-9-]+)/?$ photo-critique-categories.php?n=$1 [NC,L]
RewriteRule ^/photo-critique/category-name/([A-Za-z0-9-]+)/?$ photo-critique-by-name.php?n=$1 [NC,L]
0
 

Author Comment

by:eranhazout
ID: 34896353
Hi

thank you for you comment but it is not working, I get 404 page not found ... when i'm trying to test the rule
0
 
LVL 5

Expert Comment

by:_-MYFOX-_
ID: 34896558
You can see the site or tell me what is the address that gives you a 404 error

one question..  the files
photo-critique-categories.php
photo-critique-by-name.php
are under the root of the site ?
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 

Author Comment

by:eranhazout
ID: 34896627
yes they are under the root.
0
 
LVL 5

Expert Comment

by:_-MYFOX-_
ID: 34896734
even if I try to open directly to the page by hand gives me the error ..

http://www.gurushots.com/photo-critique-categories.php?n=Animal% 20Photography
http://www.gurushots.com/photo-critique-categories.php

They are correct two links
0
 
LVL 5

Expert Comment

by:_-MYFOX-_
ID: 34896749
even if I try to open directly to the page by hand gives me the error ..

http://www.gurushots.com/photo-critique-categories.php?n=Animal%20Photography
http://www.gurushots.com/photo-critique-categories.php

They are correct two links
0
 

Author Comment

by:eranhazout
ID: 34896763
Hi

it is not the right website, I'm using our development website.
please try on http://www.gurushots.info/photo-critique-categories.php?n=Animal%
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

609 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