S
S
Sergey Zhuzhgov2012-02-18 11:20:03
htaccess
Sergey Zhuzhgov, 2012-02-18 11:20:03

htaccess......?

Friends! Please help me with htaccess.
There is a check.php file, the markup of which is:
<?php if ($_GET[par]==0) { ?>First condition<?php }; ?>
<?php if ($_GET[par]==1) { ?>Second condition<?php }; ?>
The .htaccess file has:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.____.ru$ [NC]
RewriteRule ^(.*)$ ____.ru/ $1 [R=301,L]
RewriteRule ^about about. php
RewriteRule ^order order.php
RewriteRule ^my-orders check.php?par=0
RewriteRule ^check check.php?par=1
when writing the address ____.ru/my-orders and when ____.ru/heck displays the second condition...
tell me how to fix...

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Skpd, 2012-02-18
@sergeyzhuzhgov

RewriteRule ^about$ about.php
RewriteRule ^order$ order.php
RewriteRule ^my-orders$ check.php?par=0
RewriteRule ^check$ check.php?par=1

S
sl4mmer, 2012-02-18
@sl4mmer

topic of evil =)
Using mod_rewrite is a very expensive operation.
IMHO, you should make a single entry point, and all these redirects should be processed by the application logic.

V
VBykanov, 2012-02-18
@VBykanov

And it's better like this:
$_GET[par] -> $_GET['par']

N
Nikolai Vasilchuk, 2012-02-18
@Anonym

<?php if ($_GET[par]=='1'): ?>Второе условие<?php endif; ?>

V
VBykanov, 2012-02-18
@VBykanov

when writing the address ____.ru/my-orders, the RewriteRule ^my-orders check.php?par=0 condition is
triggered and transfers the execution to check.php?par=0 again passing through .htaccess and this RewriteRule ^check check.php? par=1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question