I have the following .htaccess
code:
RewriteRule ^Indian-Patriot-Name/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([^\x00-\x7F]+).*?$ indianpatriot.php?id=$1&lid=$2&name=$3 [B,L,QSA]
Which allows me to view the result of the following link:
example.com/Indian-Patriot-Name/104/8/ச்வடன்ற்யவீர்%20சவர்க்கார்%20రాష్ట్రీయ%20சமரக்
However, when I want to view the following URL (not unicode):
example.com/Indian-Patriot-Name/104/8/abcd
I am unable to view the output as I'm getting a "file not found" error! However, if I change the directive/regex to the following then I can read the above (non-unicode) URL properly.
RewriteRule ^Indian-Patriot-Name-English/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$ indianpatriot.php?id=$1&lid=$2&name=$3 [L]
Q. How can I combine ([A-Za-z0-9-]+)
and ([^\x00-\x7F]+)
in the same rewrite statement?
I tried:
RewriteRule ^Indian-Patriot-Name-English/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([^\x00-\x7F]+)+([A-Za-z0-9-]+)?$ indianpatriot.php?id=$1&lid=$2&name=$3 [B,L,QSA]
but I'm getting a "file not found" error again.
UPDATE: I tried the following:
RewriteRule ^Indian-Patriot-Name-English/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([^\x00-\x7F]+ [A-Za-z0-9-]+)?$ indianpatriot.php?id=$1&lid=$2&name=$3 [B,L,QSA]
But I get an Internal Server Error:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
([A-Za-z0-9-]+)
and([^\x00-\x7F]+)
as something matching the first specification can not match the second one (the characters in the first are indeed in the \x00-\x7F range that the second one want to exclude)([^\x00-\x7F]+|[A-Za-z0-9-]+)