Posts

Showing posts from January 25, 2019

HTACCESS rewriting subdomain.domain.com/folder to folder.domain.com

Image
0 Basically I am building a blog site, I have a wildcard subdomain entry which lands to a specific folder and in that folder all user information are kept in folder wise. For example - user 'dany' register for my site and I assign him a subdomain dany.myblogsite.com . This subdomain lands to userblog folder. Now I verify the all credentials in database and redirect to corresponding folder for example.. to dany.myblogsite.com/dany.myblogsite.com folder. Now I want that in url only dany.blogsite.com is visible instead of full folder path dany.myblogsite.com/dany.myblogsite.com . Basically I want to rewrite url using htaccess. RewriteCond %HTTP_HOST ^dany.blogsite.com$ [NC] Then rewrite any request to /folder RewriteRule ^(dany.blogsite.com*)$ /dany.blogsite.com/$1 [NC,L] I am using above code, but its not working.. I cant figure out how to make above code work dynamically instead of adding entry for every domain php url url-rewriting share | improve this

How to select lines and print in a list python

How to select lines and print in a list python I have a list that looks like this: 1 f 2 f 3 f 4 g 5 g 6 g and I want to print out the first two lines of f and g , as: f g 1 f 2 f 4 g 5 g any idea how to approach this? A python list cannot look like that . A list must have at least a pair of brackets. Please include the actual list in Python syntax, not a printout. Also, what did you try to solve the problem yourself? Include your code and explain what went wrong. – DYZ Sep 8 '18 at 3:34 Also address some corner cases: what if there is only one "g" item? is the letter column guarenteed to be sorted in order or can you get four 'g's followed by, say, two 'b's? – gregory Sep 8 '18 at 3:55 2 Answers 2 You could to consider grouping your list. An example: l = [['1', 'f'], ['2', 'f'], ['3', 'f'], ['4', 'g'], ['5', 'g'], ['6', 'g']] T

Dual Argentinian and US citizenship traveling to Brazil

Image
6 I have dual Argentina and United States citizenship and am currently residing in the US. I will be traveling to Brazil in February. My plan is to enter Brazil with my Argentinian passport since Argentinians are visa exempt. I will also be driving a rental car with my US driver's license since my Argentinian driver's license has expired. Could presenting my US driver's license and passport be a problem in renting a car, or if I were to be stopped by the police? I wouldn't have a tourist visa, which is required for Americans, since I will enter the country as an Argentinian citizen. Alternatively, would it be acceptable to show my international driver's license with my Argentinian passport? Looking forward to clarification. customs-and-immigration passports dual-nationality brazil share | improve this question edited Nov 22 '16 at 0:20 Giorgio 31.8k 9 64 178 asked Nov 21 '16 at 23:31 Marina Marina 33 3