Welcome Guest, Not a member yet? Register   Sign In
Super .htaccess file
#21

[eluser]JeffChan[/eluser]
The default htaccess CI provided in the documentation works for me. I looked around and saw yours. Copied it verbatum and fixed up the path. Works fantastic Big Grin

Thanks.
#22

[eluser]dbashyal[/eluser]
how can i do this?

i have site
www.site.com
which was always redirected to
www.site.com/shop

since google is not happy with redirection, i need to make it accessible through main site like this.

www.site.com loads www.site.com/shop without redirection
and,
i need to do this in another site redirect www.site.com/shop/... to www.site.com/...

thanks.
#23

[eluser]Xeoncross[/eluser]
So are you looking for something like this?

Code:
# If the file/dir is NOT real go to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /shop/index.php/$1 [QSA,L]

You can redirect from the index to a file (like index.php) in the same way you can forward site.com to site.com/shop/
#24

[eluser]uptime[/eluser]
Xeoncross - I don't think that's what he was looking for, I think he needs two different rules.

#1 - Try this (not tested):
Code:
RewriteCond %{REQUEST_URI} !shop [NC]
RewriteRule ^(.*)$ shop/$1 [L]

#2 - Try this (again, not tested but *should* work):
Code:
Redirect 301 / /shop
OR:
Code:
Redirect 301 / http://www.your-site.com/shop

Check the differences between 301 and 302 codes, it's important to choose the right one according to your needs.

- uptime
#25

[eluser]Xeoncross[/eluser]
[quote author="uptime" date="1219698396"]
Since google is not happy with redirection, i need to make it accessible...
...without redirection [/quote]

I didn't recomend a 301 or any other type of redirect because he stated that he wants the whole thing hidden from google/users eyes. In the same way we hide the "index.php/" with a default .htaccess.

I vote that you check to see if the query string includes the "shop/" part - then remove it if it does. Then either way load site.com/shop/index.php/
#26

[eluser]uptime[/eluser]
That's what I thought at the beginning... But check the following quote:
[quote author="dbashyal" date="1219675180"]how can i do this?
and,
i need to do this in another site redirect www.site.com/shop/... to www.site.com/...
[/quote]
I agree that it's not smart to show the same content in both / and /shop - I'm sure Google won't like it...
#27

[eluser]Xeoncross[/eluser]
Has anyone tried the Google translate code on a production site? So far I haven't used it except for testing purposes.
#28

[eluser]Dr. Seuss[/eluser]
I am trying to enable my pages to retrieve .swf files. This looks like it would be perfect for my needs, but does not appear to have any effect.

The old .htaccess file that I was using (which did not enable swf either) was:

Code:
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^sys.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css|swf)
RewriteRule ^(.*)$ index.php/$1 [L]

I am an htaccess scavenger and would appreciate any insight as to what I am doing wrong. Smile
#29

[eluser]quasiperfect[/eluser]
hmm good job with the htacces but what if i want to allow some folders like images,js etc. ?
#30

[eluser]bd3521[/eluser]
I don't understand why by default the system and application directory are public (with index.html's scattered around for security of course).

Why not do ...

html (static content and index.php)
application (everything you do)
system (everything CI)




Theme © iAndrew 2016 - Forum software by © MyBB