In my social engine web site , it always shows mydomain.com/index.php instead of mydomain.com
For example when we access the member page it shows mydomain.com/index.php/member , but actually I would like to get it as mydomain.com/members
Please see my htacess code under /public folder here
<FilesMatch "\.(avi|flv|mov|wmv|wma|mp3|mp4|m4a|mkv|swf|pdf|doc|ppt|ico|jpg|jpeg|png|gif|js|css)$">
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A29030400
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
<IfModule !mod_expires.c>
<IfModule mod_headers.c>
Header set Expires "Sun, 1 Jan 2012 00:00:00 GMT"
Header append Cache-Control "max-age=172800, public"
</IfModule>
</IfModule>
</FilesMatch>
How can I solve this ?
Thanks in advance
Sunil
Why your .htaccess is inside /public folder? It should be inside a root socialengine folder, where .htaccess enables rewrite mode...
Related
i've a htaccess where i want to
- hide contents of folders -> this one ok
- redirection where we're in the wrong link -> this one is ok
- solve the problem of validator with the chrome meta -> this one i'm not sure
Here is my htacces, is it correct ?
options -indexes
ErrorDocument 404 /404/index.php
<FilesMatch "\.(htm|html|php)$">
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</FilesMatch>
I want to automatically add the X-Robots-Tag header for all php, htm, html pages EXCEPT /index.php and forgot.php.
This would cover all of them:
<FilesMatch "\.(htm|html|php)$">
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex, nofollow"
</IfModule>
</FilesMatch>
But how can I exclude /index.php and /forgot.php from that FilesMatch directive?
What I want it to do :
Valid for all .htm, .html, .php files
Exclude for /index.(htm|html|php), /forgot.(htm|html|php), but not */index.php should be valid.
Hopefully that makes sense... I just want to exclude it from those two specific files at the base of the site.
UPDATE:
Playing around with this on tester, but still have some issues :
(?!.*/(index.php|forgot))(^.*\.(php|htm|html)$)
this is excluding URLs like www.mysite.com/folder/index.php
I was looking at this wrong the whole time. Here is what I am using :
# BEGIN noindex,nofollow on all but login and forgot page
<IfModule mod_env.c>
RewriteRule ^(index\.php|forgot\.php)$ - [E=exclude:1]
<FilesMatch "\.(php|html?)$">
<IfModule mod_headers.c>
Header set X-Robots-Tag "noindex, nofollow" env=!exclude
</IfModule>
</FilesMatch>
</IfModule>
What have you tried? Have you tried something like this?
<FilesMatch "^(^index|^forgot)\.(htm|html|php)$">
Just want to point you in the right direction. I haven't tried this yet, but it's probably going to be a bit greedy and match files like index_example.php as well. Not just index.php.
These guys have an excellent reference on RegEx: http://www.regular-expressions.info/
I added next lines in .htaccess, which I found here How to specify vary accept encoding header in htaccess
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
but it isn't works, also I checked phpinfo (Loaded Modules: mod_headers...).
I use Page Speed plugin and I can't see this header in my css file.
Why it isn't works?
Maybe you want use this:
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
with semicolon
Add this one in .htaccess file ,it will work
<IfModule mod_headers.c>
<FilesMatch ".(js|css|xml|gz|html)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
If the other examples doesn't work, try this:
<IfModule mod_headers.c>
Header set Vary "Accept-Encoding"
</IfModule>
In my .htaccess I have this code:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|html|x-html|php|css|xml|js|woff|ttf|svg|eot)(\.gz)?$">
ExpiresActive On
Header set Expires "Sun, 27 May 2012 00:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>
It seems to work perfectly on some servers, but not on one of my websites. I get a 500 Internal Server Error.
Is there anything wrong in the config, or do I have to contact my host?
Ensure that you have these Apache modules enabled and loaded:
ExpiresActive -- mod_expires
Header -- mod_headers
Try this instead (it will only use directives if corresponding module is present):
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|txt|html|x-html|php|css|xml|js|woff|ttf|svg|eot)(\.gz)?$">
<IfModule mod_expires.c>
ExpiresActive On
</IfModule>
<IfModule mod_headers.c>
Header set Expires "Sun, 27 May 2012 00:00:00 GMT"
Header unset ETag
</IfModule>
FileETag None
</FilesMatch>
I am currently trying to improve website loading times and I am using the following:
<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
</FilesMatch>
</IfModule>
That works great ... I was wondering if it is possible not to have a fixed date there. Can I do something like this?
<IfModule mod_expires.c>
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 10 years"
</FilesMatch>
</IfModule>
Doesn't seem to work ATM :S
Thanks
Regards
Gabriel
To enable ExpiresDefault, you need to set ExpiresActive to on as in:
<IfModule mod_expires.c>
ExpiresActive On
############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 10 years"
</FilesMatch>
</IfModule>
The above answer should solve your question. For other cases: mod_expires is not a default Apache module, it's an extension. Make sure that it is enabled, which you can do using phpinfo() on a PHP-enabled server. If you have shell access, you can run apachectl -t -D DUMP_MODULES.