Hi
I want to use htaccess rewrite, which will act as below
1. http://mysite.com/?sura=x as http://mysite.com/x
2. http://mysite.com/?sura=x as http://mysite.com/x/
3. http://mysite.com/?sura=x&ayat=y as http://mysite.com/x/y
4. http://mysite.com/?sura=x&ayat=y as http://mysite.com/x/y/
is it possible by htaccess ??
please help me
arctushar
0
Junior Poster in Training
Recommended Answers
Jump to PostYes, it is possible. Here is a nice little htaccess rewrite generator that can write it for you too :)
Jump to Posttry this:
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ /?sura=$1&ayat=$2 [L]
RewriteRule ^([a-zA-Z0-9-]+)$ /?sura=$1 [L]they must be in this order, in case there is only 1 param, the second rule will be 'executed'. also you may want to limit the type of characters that params can take.
All 5 Replies
pixelsoul
272
Red Pill
Featured Poster
arctushar
0
Junior Poster in Training
dorco
12
Light Poster
arctushar
commented:
thanks
+2
arctushar
0
Junior Poster in Training
dorco
12
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.