.htaccess

Remove index.php from URL, Laravel 5.2

故事扮演 提交于 2020-01-15 09:28:07
问题 I saw a lot of examples and tried a lot of solutions without success! I am trying to put my project to Ubuntu server with apache. everything its ok when I do : "/MYEXAMPLE/public/index.php/dashboard" But I want: "/MYEXAMPLE/public/dashboard" And there is the problem! "The requested URL /MYEXAMPLE/public/dashboard was not found on this server." My apache server has de mod_rewrite. My project folders are: - MYEXAMPLE --------- server.php --------- public ----------------.htaccess.php ----------

Leverage Browser Caching js?ver=

别来无恙 提交于 2020-01-15 09:15:06
问题 I'm facing an odd problem with my Leverage Browser Caching. In my .htaccess I use the following: ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/pdf "access plus 1 month" ExpiresByType text/x-javascript "access plus 1 month"

Redirect raw .gif files to handler page via .htacces - my code doesn't work

百般思念 提交于 2020-01-15 09:14:09
问题 I have a viral image site where people can view funny gifs. A lot of people on reddit are sharing the raw .gif files however, rather than the page with .gif embedded. This is fine - but I'd like to redirect all people viewing raw image .gifs to a handler page called shareraw.php (located in root directory). This handler page will look exactly the same - just with a share link and button to check out the rest of the site. Example of raw image location: http://gifsec.com/wp-content/uploads/GIF

How to protect all directory contents, but gain access to php script

回眸只為那壹抹淺笑 提交于 2020-01-15 09:11:01
问题 I have an folder in my apache public folder and it's contents must be protected at all time. Let's say the folder is called 'protected'. When someone then tries to open http://domain.com/protected/random.file, that someone shouldn't be able to open/download it. Access should be completely blocked, with no possible workarounds. I'm building an portal for an company wich wants to be able to only publish files to authorised users. The portal I made has an custom made php authentication method.

Redirect 301 - why is my old url being appended to my new url causing a 404 error?

时光毁灭记忆、已成空白 提交于 2020-01-15 09:10:48
问题 Redirect 301 /features/blahblah.php http://www.mysite.com/articles/blahblah1.php results in http://www.mysite.com/articles/blahblah1.php?q=features/blahblah.php which is a 404 error page not found. So what am i doing wrong here 回答1: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect documents exactly what's happening. You probably want to use RedirectMatch, something like: RedirectMatch ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php If you want it to be a

Redirect 301 - why is my old url being appended to my new url causing a 404 error?

南楼画角 提交于 2020-01-15 09:10:14
问题 Redirect 301 /features/blahblah.php http://www.mysite.com/articles/blahblah1.php results in http://www.mysite.com/articles/blahblah1.php?q=features/blahblah.php which is a 404 error page not found. So what am i doing wrong here 回答1: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect documents exactly what's happening. You probably want to use RedirectMatch, something like: RedirectMatch ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php If you want it to be a

Redirect 301 - why is my old url being appended to my new url causing a 404 error?

不问归期 提交于 2020-01-15 09:10:05
问题 Redirect 301 /features/blahblah.php http://www.mysite.com/articles/blahblah1.php results in http://www.mysite.com/articles/blahblah1.php?q=features/blahblah.php which is a 404 error page not found. So what am i doing wrong here 回答1: http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect documents exactly what's happening. You probably want to use RedirectMatch, something like: RedirectMatch ^/features/blahblah.php http://www.mysite.com/articles/blahblah1.php If you want it to be a

Creating variable in apache config

穿精又带淫゛_ 提交于 2020-01-15 09:07:11
问题 I have an apache config something like below: RewriteCond %{QUERY_STRING} ^site=(eu|jp|in)$ [NC] RewriteRule ^/?fetchHomePage.action$ https://example.com/%1? [R=301,L,NC] RewriteCond %{QUERY_STRING} (?:^|&)site=(eu|jp|in)(?:&|$) [NC] RewriteRule ^/?fetchFirstPage.action$ https://example.com/firstPage/%1? [R=301,L,NC] RewriteCond %{QUERY_STRING} (?:^|&)site=(eu|jp|in) [NC] RewriteRule ^/?fetchSecondPage.action$ https://example.com/secondPage/%1? [R=301,L,NC] Can I store "(eu|jp|in)" in some

How to mask a URL in a website?

纵饮孤独 提交于 2020-01-15 08:05:23
问题 I want to "mask" a URL. I have a subdomain that I do not want people to know about on my website. So what I am needing help with is this: My website is: www.example.com I have a subdomain: sub.example.com/test.php When someone clicks on a link that points to sub.example.com/test.php, I do not want "sub.example.com/test.php" to show in the url bar. I would like for www.example.com to show instead. 回答1: When you want to link to sub.example.com/test.php , change the link to something else, like

Laravel 5 returns 404 error for every page

拟墨画扇 提交于 2020-01-15 07:35:10
问题 I am having trouble configuring Apache and my project's .htaccess file. I am storing it in a subfolder in /var/www/html, and aliasing it via Apache. I have also added RewriteBase to my .htaccess file. Accessing to the alias (server.ip/blog) lists the public directory, but everything I try to access returns a 404 error. Any ideas? .htaccess: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ /index.php [L] RewriteBase