.htaccess

.htaccess folder and file name conflict in url rewrite

I have the following htaccess to allow for no file extensions in the url: Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php My problem is that i have both a file called images.php and a folder called images, so when i use the url: .com/images - it...

FCKEditor don't work after upload on my site.

I use FCKEditor as an editor on my website. I create website on my local host and put editor in it and it works fine. But after uploading my website (include FCKEditor dir), editor not work! No directory and nothing of source was changed! There is an .htacess file in FCKEditor directory. Is it the problem? sorry for bad Enghish! ...

Detect if a page have been called via .htaccess RewriteRule in PHP

Hi, I am using .htaccess RewriteRule on a website I'm working on. Here is a sample of my .htaccess RewriteEngine on RewriteRule ^about.htm$ /index.php?load=about&output=html [NC] I would like to know if there is a way in my index.php file to detect if the page have been called via a Rewrite or the user reached it directly. I'm tryin...

Replace @ with _at_ in URL .htaccess

Hi, I have the following URL: http://testhost.com/offers/311/133/[email protected]/ and I'm wanting to redirect it to this url: http://testhost.com/offers/311/133/test_at_test.com/ Can someone provide me with the Rewrite Conditions and Rule to do this? Thanks in advance! ...

Deny direct access to files or directory using .htaccess

Hi! I'm playing with .htaccess and I was wondering if with just an .htaccess inside the root directory is possible to block all the request from a browser directed on existing files or directories. Let's try this example: RewriteEngine On RewriteBase /~my_user/my_base/ RewriteRule ^list/$ list.php [L] RewriteRule ^element_of_list/([a...

.htaccess http://www. and http:// : what is the influence for SEO ?

Hello, I am trying to improve my SEO rank : I use http://www.woorank.com tool I have a "sever error" that tells me: Be sure that http://roulette-chat.fr and http://www.roulette-chat.fr are not running in parallel. Redirecting requests from a non-preferred hostname is important because search engines consider URLs with ...

.htaccess & and %26 both splitting $_GET

Below is my .htaccess file for this particular articles folder. My problem is that these urls both split the $_GET variable when received by the php script. /food-and-diet/articles/test-&-cake.html /food-and-diet/articles/test-%26-cake.html Both of these urls create this $_GET array: Array ( [article] => test- [-cake] => [folder] =>...

How To Include a PHP File Site-wide Using .HTACCESS or other methods

Hi. I want to include my PHP file googleanayltics.php on every page on my webserver that is a .php or .html document I would like to know: A) How do I add this right BEFORE the </head> tag B) How do I add right right AFTER the <body> tag I'd like to know both methods for flexibility I think .HTACCESS could accomplish this easily, an...

url rewriting directory issue (htaccess)

Good morning. I currently have this little rule in my .htaccess RewriteEngine On RewriteBase / RewriteRule ^brochure/([0-9]+)$ /brochure.php?cat_path=$1 [L] (i'm just using numbers for example here, will be category names later.) This redirects perfectly, but when it does, everything I have in directories now fail (css, js, images, ...

Internal Error when file does not exist

I want get everything up to the "/" and merge with ".php" works fine, but when the file does not exist I get internal error RewriteRule ([^\/]*) $1.php ...

Zend Framework and Wordpress Integration

We have an existing Zend Framework site hosted at ourdomain.com and a wordpress blog at blog.ourdomain.com We want to migrate the blog into the site at ourdomain.com/blog - but I seemed to have googled to the end of the earth and cannot find out how. I have tried various .htaccess stuff, setting up a blog controller and including some w...

Mask www.oldsite.com/home with www.newsite.com

How can I mask so all instances of www.oldsite.com are replaced with www.newsite.com example: I'd like to replace: http://www.oldsite.com/home/b.jsp?id=9912&amp;ln=115-991632 with www.newsite.com/home/b.jsp?id=9912&ln=115-991632 ...

How can I disable automatic opening/saving of file downloads

If I have a mp3 or wav file on a page... when i visit that page in Internet Explorer it starts downloading that mp3 or wav or mov file automatically instead of playing that file. How can i prevent that either with .htaccess or php or html? ...

Hotlinking protection

ok so i have a couple of working codes RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://site.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://site.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.site.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.site.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp|mp...

Help needed with mod_rewrite and htaccess for Drupal

I want to enable .htaccess files on my server in order to use "clean_url" functionality in Drupal. This is what I've done so far: sudo a2enmod rewrite sudo /etc/init.d/apache2 restart cd /etc/apache2/mods-enabled grep mod_rewrite * In phpinfo() results I can see: mod_rewrite, so I guess the module is enabled. I've added a htaccess f...

simple redirect to default page with htaccess

The htaccess file requires an entry at the end of /folder/ to redirect the page example: http://www.server.com/folder/"some-page-name" If no page is defined as, then I want it to be "index" by default the htacess RewriteBase /folder/ RewriteRule ^(.*)$ subfolder/index.php/?page=$1 [L] ...

Mod_rewrite: How to catch .php files?

I'm trying to catch all .php requests so that my visitors won't be able to see the php magic I want example.com/home to be redirected to example.com/index.php, but I don't want direct access to example.com/index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] Although ...

Simple (?) redirect using .htaccess

Hello, this is probably simple but i don't know how to do it. I want all links of this form: http://www.fractalbit.gr/archives/xxx to redirect to this: http://www.fractalbit.gr/?p=xxx ...

htaccess direct domain and subdomain ?

Hi Guys, I have a problem where I want to redirect all traffic [301 permanent] from www.example.com --> www.website2.com blog.example.com --> blog.example.com So redirect all domains/subdomains on "Example.com" to website2.com EXCEPT for the blog on example.com ? Little unsure how to set this up using .htaccess on "example.com" ? ...

.htaccess mod_rewrite and navigating back directories

I have what may or may not be a peculiar problem, I need to point the htaccess file back three directories before finding the directory I am looking for. My understanding of navigating directories using mod_rewrite is limited, so I wanted to ask how to write an htaccess file that will do this: URL: example.com/css/styles.css Accesses fi...