1

My code produce URL like this:

http://domain.com/netRacuni/tcpdf/examples/pdf.php?key=bi5u3w2zys1v9sqijomsqyya5ge2v5 

How I can make it like this:

http://agroagro.com/bi5u3w2zys1v9sqijomsqyya5ge2v5 

so only domain.com+key to be there?

1 Answer 1

2

You can a try a rule like this in your root .htaccess.

RewriteEngine On RewriteCond %{QUERY_STRING} ^key=(.+)$ RewriteRule ^netRacuni/tcpdf/examples/pdf.php$ /%1? [L] 

Edit: Sounds like you want it the other way around. Your question isn't too clear.

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/?$ /netRacuni/tcpdf/examples/pdf.php?key=$1 [L] 
Sign up to request clarification or add additional context in comments.

2 Comments

hm I have now domain.com/netRacuni/tcpdf/examples/… and I try: domain.com/wwbw91jsc1qdc92bq4b855ssg115wi but give me 404 Not Found...
So you want it the other way around? Try the updated rule and see if that's what you want, if not add your current .htaccess rules to your question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.