.htaccess

Prevent access to php pages

牧云@^-^@ 提交于 2020-01-22 02:47:07
问题 Ok, so I have set the .htaccess like so: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)$ index.php so as you can see I'm parsing everything to index except files because I need to "include" the php files and also displaying of images. If users will type for example www.site.com/login.php that will show the login php page. How do I prevent access to the php pages but also allow to "include" them? 回答1: Move them outside of your document root.

Codeigniter | OVH | htaccess / url rewriting | Site very slow

落花浮王杯 提交于 2020-01-22 02:10:10
问题 Here is my htaccess for removing the index.php with codeigniter : RewriteEngine On RewriteCond $1 !^(index\.php|assets|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] But with this .htaccess, there is an error "File not found." So, I'm searching, and here is a little solution : http://forum.ovh.com/showthread.php?93572-Codeigniter-et-htaccess Adding a "?" resolve the problem, but the site is sometimes very very slow, and sometimes very fast ! And sometimes, my style sheets don't load (assets

htaccess rewrite url from different pages

℡╲_俬逩灬. 提交于 2020-01-22 01:43:33
问题 i make this in htaccess file .. for rewrite url from different page Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1 [QSA] RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1 [QSA] and it's works fine .. now i need to add more as facebook you can put facebook.com/username which is : facebook.com/profile.php?username= & you can put facebook.com/pagename which is : facebook

htaccess rewrite url from different pages

荒凉一梦 提交于 2020-01-22 01:43:20
问题 i make this in htaccess file .. for rewrite url from different page Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1 [QSA] RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1 [QSA] and it's works fine .. now i need to add more as facebook you can put facebook.com/username which is : facebook.com/profile.php?username= & you can put facebook.com/pagename which is : facebook

Persistent URL query string throughout the entire site?

自古美人都是妖i 提交于 2020-01-22 00:41:30
问题 This is one of those situations where I feel like there is a simple answer right in front of me...hopefully you guys/gals can show me the light. PROBLEM : I have a client that wants to maintain a query string across all pages on their site, only if they arrived at the site via a link that contains the query string. This query string would also need to be passed with any external link from the site. INFORMATION : An example of the query string : ?utm_medium=<ad_placement>&utm_source=<ad_source

Persistent URL query string throughout the entire site?

耗尽温柔 提交于 2020-01-22 00:41:04
问题 This is one of those situations where I feel like there is a simple answer right in front of me...hopefully you guys/gals can show me the light. PROBLEM : I have a client that wants to maintain a query string across all pages on their site, only if they arrived at the site via a link that contains the query string. This query string would also need to be passed with any external link from the site. INFORMATION : An example of the query string : ?utm_medium=<ad_placement>&utm_source=<ad_source

How to change URL? htaccess

一个人想着一个人 提交于 2020-01-21 21:49:11
问题 What I have newsy/czytaj/items/odbierz-250zl-na-reklame.html This is what I would have newsy/odbierz-250zl-na-reklame.html How to do this with mod-rewrite ? I don't understand RewriteRule. My .htaccess RewriteEngine On RewriteCond %{REQUEST_URI} (ftp|https?):|/etc/ [NC,OR] RewriteCond %{QUERY_STRING} (ftp|https?):|/etc/ [NC] RewriteRule .* - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .*\.html$ index.php [L] 回答1: RewriteEngine on RewriteRule

Apache .htaccess to hide both .php and .html extentions

谁说胖子不能爱 提交于 2020-01-21 15:19:05
问题 What lines should I add to remove both .html and .php extensions from my site? I use this for just the .html part: RewriteEngine on RewriteBase / RewriteCond %{http://jobler.ro/} !(\.[^./]+)$ RewriteCond %{REQUEST_fileNAME} !-d RewriteCond %{REQUEST_fileNAME} !-f RewriteRule (.*) /$1.html [L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP RewriteRule ^([^.]+)\.html$ http://jobler.ro/$1 [R=301,L] but I need for both file type extensions to be hidden from the same domain. 回答1: I

Redirect index.php in CodeIgniter

房东的猫 提交于 2020-01-21 12:10:09
问题 I created a CodeIgniter application and now I'm trying to redirect the urls with index.php to urls without it. My current .htaccess is: RewriteEngine On RewriteBase / # Removes trailing slashes (prevents SEO duplicate content issues) RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ $1 [L,R=301] # Enforce www # If you have subdomains, you can add them to # the list using the "|" (OR) regex operator RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC] RewriteRule ^(.*)$ http://www.plugb.com/

Redirecting www to non-www while maintaining the protocol HTTP or HTTPS

无人久伴 提交于 2020-01-21 09:07:10
问题 I'm attempting to redirect www to non-www for both HTTP and HTTPS requests. My root .htaccess looks like this: RewriteEngine on RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteRule ^(.*)$ http://example.com/$1 [R=301] RewriteCond %{HTTP_HOST} ^www.example.com$ RewriteCond %{SERVER_PORT} ^443 RewriteRule ^(.*)$ https://example.com/$1 [R=301] This isn't fully working as expected. What happens: Visiting http://www.example.com results in a redirect to http://example.com . This indicates my