I want to redirect all to one script e.g. index.php?url=inputurl
With if/else I want to parse url
in index.php run query for url in my custom table
- if url is mach: echo “ok”
- else do nothing
How should I set .htaccess in root folder of WordPress?
Example:
URLs in custom_table:
- asd
- dfg
- ghj
If user puts:
-> mod_rewrite should output this: http://www.mysite.com/index.php?url=asd
Else if user puts:
-> do nothing
I think the following .htaccess should solve the problem:
Edit: to not include your folders and files (like /js, /css, etc.) in rewrite, add the following lines before the
RewriteRuleline (see comments):And in the PHP script: