.htaccess

htaccess identical folder and file name

偶尔善良 提交于 2020-02-04 06:33:45
问题 How can I set up an htaccess that can distinguish a file from a folder with the same name? I have under my website index.php team.php team/Justin.php team/martin.php... and a htaccess with a URL Rewrite to make nice url and remove the .php RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Unfortunately when I go to the url mywebsite.com/team it goes straight to the team folder... I would like mywebsite.com/team goes to --> team.php page mywebsite.com

Open htaccess password protectected page with no prompts

倖福魔咒の 提交于 2020-02-03 12:18:19
问题 I have a directory on a website that is password protected via htaccess. I want to be able to open this web page through my application without having the user enter the password but rather do it programatically. For instance, is there a way I can embed the login information in the URL? Such as http://www.mypage.com/page.html?htaccesspassword=asdasdas thanks! 回答1: scheme://username:password@host/path 回答2: Although I think that authentication through the URL, as described by Ignacio Vazquez

Disable Directory Browsing using htaccess

隐身守侯 提交于 2020-02-03 07:59:26
问题 in my server I have a series of folders. I would deny the access to all this folders. How can I do? What rule I have to use? 回答1: add one line in your .htaccess root: deny from all @QUESTION: if you want to retain access for yourself: allow from 192.168.1.1 subsitute in your real IP for the one i gave in the example. so all together: deny from all allow from YOUR_IP @QUESTION2: if you deny access to a directory, you are denying access to all of the nodes in that directory like the "pages". if

ModRewrite with HTTPS [closed]

倖福魔咒の 提交于 2020-02-02 16:20:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I'm using the following mod rewrites to ensure not only canonical URLs, but also that the site is displayed using HTTPS: RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} // It think the problem must be here --^ RewriteCond %{HTTP_HOST} ^rto12\.ca$ [NC] RewriteRule ^(.*)$ https://www

ModRewrite with HTTPS [closed]

青春壹個敷衍的年華 提交于 2020-02-02 16:20:07
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I'm using the following mod rewrites to ensure not only canonical URLs, but also that the site is displayed using HTTPS: RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} // It think the problem must be here --^ RewriteCond %{HTTP_HOST} ^rto12\.ca$ [NC] RewriteRule ^(.*)$ https://www

<a href> appends link to end of current url

非 Y 不嫁゛ 提交于 2020-02-02 13:49:27
问题 So whenever I upload a .html file to my website and have tags the new url the link brings the user to appends the link to the end of the current url. For example, if my website was example.com and the index.html file was placed in example.com/test and the link was google.com then the link would bring me to example.com/test/google.com. How do I make it so the a href tag brings me to google.com in this case. Thank you! 回答1: You should really learn about absolute and relative paths. What you're

<a href> appends link to end of current url

十年热恋 提交于 2020-02-02 13:48:52
问题 So whenever I upload a .html file to my website and have tags the new url the link brings the user to appends the link to the end of the current url. For example, if my website was example.com and the index.html file was placed in example.com/test and the link was google.com then the link would bring me to example.com/test/google.com. How do I make it so the a href tag brings me to google.com in this case. Thank you! 回答1: You should really learn about absolute and relative paths. What you're

make all subdomains access website root files

五迷三道 提交于 2020-02-01 09:15:06
问题 Here's what I want to do: Let's say i have www.mysite.com and it's a complex website with alot of files I want to make fr.mysite.com, it.mysite.com, uk.mysite.com to access the file in the root website (ie: fr.mysite.com/jobs.php will actually load mysite.com/jobs.php but in the browser url it will show the link with subdomain). I want to build a site with content from multiple countries and I want each country to be accessed with it's code as a subdomain. If I can do that I can then process

remove index.php url rewriting .htaccess

余生长醉 提交于 2020-02-01 04:36:18
问题 I'd written this code for 301 redirect RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L] It is working well in case if I do visit my site as http://mysite.com/index.php , it redirects me to http://mysite.com But on my localhost if I try to visit index.php as localhost/mysite/index.php it redirects me to localhost . How could I solve this problem? Is the code written above is correct? 回答1: It looks like you have your htaccess file in your document

remove index.php url rewriting .htaccess

别等时光非礼了梦想. 提交于 2020-02-01 04:36:15
问题 I'd written this code for 301 redirect RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L] It is working well in case if I do visit my site as http://mysite.com/index.php , it redirects me to http://mysite.com But on my localhost if I try to visit index.php as localhost/mysite/index.php it redirects me to localhost . How could I solve this problem? Is the code written above is correct? 回答1: It looks like you have your htaccess file in your document