Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
220 views
in Technique[技术] by (71.8m points)

php - Wildcard Subdomains using htacess with multiple variables

I have actually written a htaccess rewrite rule for creating wildcard subdomain from get method but the problem is that I can't use any other get variable on the page.

here is the website https://mywebsite.efficientpoint.com/test_view?id=cloth

variable id is undefined

test_view.php

$id= $_GET['id'];

$sitePostName = $_GET['url'];
<h1>The website url is (<?php echo $sitePostName; ?>)</h1>
<h4>The product is (<?php echo $id; ?>)</h4>

.htaccess

RewriteRule ^([aA-zZ])$ test_view.php?url=$1

RewriteCond %{HTTP_HOST} ^(^.*).efficientpoint.com

RewriteRule (.*) test_view.php?url=%1

OUTCOME:

The website url is (mywebsite)
The product is ()

So you see the bracket for product is blank.

Please I will be grateful if anyone can help me out there. Thank you.

question from:https://stackoverflow.com/questions/65897352/wildcard-subdomains-using-htacess-with-multiple-variables

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...