Search Results

Search found 2190 results on 88 pages for 'htaccess'.

Page 14/88 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Problem with .htaccess (mod_rewrite). RewriteRule's doens't work correctly

    - by daniel
    Hello, I have a problem with my two RewriteRules. .htaccess: # protect the htaccess file <files .htaccess> order allow,deny deny from all </files> RewriteEngine On Options +FollowSymlinks Options -Indexes RewriteBase /test/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^download/([0-9]+)$ download.php?id=$1 [L] RewriteRule ^(.*)$ index.php?c=view&misc=$1 [B] If the url contains download (some like this: mydomain.com/download/9) the first rule should redict this request to download.php?id=9. But it doesn't. var_dump($_GET) shows the following: array(2) { ["c"]=> string(4) "view" ["misc"]=> string(9) "index.php" } index.php Any ideas?

    Read the article

  • .htaccess password and forced login

    - by Boco
    I have password protected website with .htaccess. What I want to do now is to force users to login from the index.html page and not from any other which they can do now. ie. I have index.html (the main page) and I have two other pages 1.html and 2. html also protected with .htaccess password. Users can now type http://www.mypage.com/1.html and they will be asked for login data but I would like to force them (before they are asked for login details) to index.html to login. After they are loggedin they can use any link (ie.1.html or 2.html) as they want. Can this be done by using .htaccess? I would need the whole code. Thank you!

    Read the article

  • Accessing a webpage folder with .htaccess in it via apache webdav?

    - by pingo
    I have setup webdav access in order to enable an external user to upload the content of his web page to his folder on my server that is served by apache to the web. This way he could update his web page via webdav. Now the problem is that the user requires a .htaccess file and of course .htaccess breaks webdav probably because it overrides settings. (new files cannot be uploaded anymore via webdav if below specified .htaccess exists) I am running Apache2.2.17 and this is my webdav config: Alias /folderDAV "d:/wamp/www/somewebsite/" <Location /folderDAV> Order Allow,Deny Allow from all Dav On AuthType Digest AuthName DAV-upload AuthUserFile "D:/wamp/passtore/user.passwd" AuthDigestProvider file require valid-user </Location> This config is part of my naive solution to fixing this problem. The idea was to specify an alias to the web page folder where webdav would be enabled and then set AllowOverride to none so that the .htaccess would have no effect. Of course I then found out that in <Location /> AllowOverride directive is not valid. The .htaccess file looks like this: #opencart settings Options +FollowSymlinks Options -Indexes <FilesMatch "\.(tpl|ini)"> Order deny,allow Deny from all </FilesMatch> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA] ErrorDocument 403 /403.html deny from 1.1.1.1/19 allow from 2.2.2.2 What would be the solution here? I would like to have the web page accessible from the web but at the same time be able to access and modify it via apache's webdav (with digest auth). How would I do that? Also if possible I would like a solution that permits the existence of the .htaccess so that the user still has the power to setup access rules for his web page.

    Read the article

  • Weird .htaccess password request that I didn't make...

    - by Dixon Crews
    Okay. So I went on a trip, came back, and suddenly, a website that I was working on is now asking for a username and password á la .htaccess. Thing is, I never made this happen and there is no .htaccess file anywhere to be found. Here is the site: link I didn't buy the template from omegathemes.com, whatever that is. And when you go there, it asks for the same kind of user and password. Any help?

    Read the article

  • Amazon EC2 php/fedora htaccess mod_rewrite not working

    - by wes
    Amazon EC2 with Fedora, there are 2 instances of the httpd conf, the doc root is automatically set as /home/webuser/helloworld/conf/httpd.conf and the default (which is also there) is /etc/httpd/conf/httpd.conf . Mod rewrite is enabled with both, we are in drupal, the .htaccess is in the folder it needs to be (on Drupal) and it loads the homepage and other static files fine, but it WILL not use htaccess. Any thoughts?

    Read the article

  • Porblem with remove trailing slash and non-www to www - using .htaccess

    - by HoanNguyen
    I'm facing an issue with .htacess when combining 2 mod_rewrite at the same time: remove trailing slash redirect non-www to www Here is my .htaccess file Options +FollowSymLinks RewriteEngine On RewriteBase / # Redirect non-www to www RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule ^(.+)/$ http://www.domain.com/$1 [R=301,L] # Remove trailing slash RewriteCond %{HTTP_HOST} ^domain.com RewriteRule (.*) http://www.domain.com/$1 [R=301,L] They worked perfectly when I just used one of them, but when i put them together, the page just keep loading like forever. Please help me to find a way that can use both of them in the same .htaccess :( Many thanks :)

    Read the article

  • Use .htaccess to change the url PHP sees

    - by incrediman
    I want to use htaccess to not only choose the script that processes the request, but also to change the request uri as php sees it. Can this be done? For example: RewriteRule /funstuff/ funstuff.php ...How can I change that RewriteRule or otherwise change my .htaccess file to get funstuff.php to think that the original request url was actually http://www.example.com/funstuff.php and not http://www.example.com/funstuff/?

    Read the article

  • .htaccess | Adding A Second Vanity URL

    - by Necro.
    I want to take my .htaccess file and add a second rule for another vanity URL as I already have one declaring the page. So how would I write it so I can go to my page, and the next vanity being a variable for a profile? Ex:// mywebsite.com/page/profile Here is my current .htaccess file. RewriteEngine On RewriteBase / RewriteRule ^([a-zA-Z0-9-]+)$ index.php?p=$1 [L] RewriteRule ^([a-zA-Z0-9-]+)/$ index.php?p=$1 [L]

    Read the article

  • Redirection using .Htaccess file

    - by user310850
    Iam working on Ubuntu.(Linux) I want to redirect from the page one.php to two.php, which are in a folder 'test' How can i do this, using .htaccess file? Any other setting is needed for this? Ur .htaccess redirection will not work for local system

    Read the article

  • Setting subdomains using htaccess

    - by milan
    Hi all I want to set a subdomain for all site users, like www.companyname.mydomain.com I would like to use htaccess for this. when somebody requests www.companyname.mydomain.com it should redirect to myfile.php?name=companyname How can I achieve this using an htaccess file ? Thanks for the consideration.

    Read the article

  • How secure is .htaccess protected pages

    - by Steven smethurst
    Are there any known flaws with htaccess protected pages? I know they are acceptable to brute force attacks as there is no limit to the amount of times someone can attempt to login. And a user can uploaded and execute a file on the server all bets are off... Anything other .htaccess flaws?

    Read the article

  • htaccess change DirectoryIndex priotiry to php and not html

    - by Jayapal Chandran
    In a production server there are index.html and index.php By default index.html is getting loaded. I want index.php to be the default script to load and if index.php is not present then index.html can load. It is a shared hosting so we do not have access to the httpd.conf file So i thought of creating .htaccess file which would do the above condition. What is the directive to include in .htaccess file to do so?

    Read the article

  • & symbol problem in htaccess

    - by muralikalpana
    hello.... my current url is categories_name.php?cname=at&t rewritten url like this. carriers/at&t this is htaccess url. RewriteRule ^carriers/(.*)$ categories_name.php?cname=$1 [L] above url is working for all like categories_name.php?cname=all-tel when variable(at&t) has '&' symbol then problem occuring. so how to write htaccess url?

    Read the article

  • .htaccess Error

    - by Starx
    If this is not correct post, please migrate it I kept a .htaccess file in my public_html folder inside the root. When I view the website it is giving server misconfiguration error. my .htaccess file contains this only php_value upload_max_filesize 100M php_value post_max_size 100M I wonder what may be wrong. Any Ideas

    Read the article

  • Old mod_rewrite (htaccess) rule still applies

    - by Blake
    I had a rule in the .htaccess file in my root directory that said: RewriteCond ^(.*)$ $1.php I've completely rewritten the file since then, and the rule is still being applied. I tried restarting the Apache server and the physical server with no luck. I've also scoured the directory and there are no other .htaccess files in there or any subdirectories. Does anyone know what might be causing something like this to happen?

    Read the article

  • htaccess turn on php flags if certain IP address

    - by fire
    In my .htaccess file I need to turn on the following: php_flag display_errors On php_value error_reporting 2147483647 However I only want to do this if my IP is visiting the site. Any ideas? Something like... if (ip == "x.x.x.x") { php_flag display_errors On php_value error_reporting 2147483647 } Need to do this in .htaccess NOT in the PHP thanks!

    Read the article

  • Using .htaccess to change my website URLs

    - by James P
    I have some pages organised like this: http://localhost/index.html http://localhost/download.html http://localhost/contact.html And I need them changed to suit the following URL structure: http://localhost/ http://localhost/download http://localhost/contact Without making sub directories and putting in pages as index.html. As far as I know .htaccess can be used for this, but I have no idea what I need to add to my .htaccess file to make this work. Can anyone provide some help? Thanks.

    Read the article

  • Make subfolder the root folder for everything in subfolder

    - by Illes Peter
    Hi there. I am working on a project that i host on my server. My server is mydomain.com and i want my project to run in mydomain.com/project. I wish to put an htaccess file in the project subfolder, so that in every file of the project, / will point to mydomain.com/project instead of mydomain.com So / will be mydomain/project, /lib/img will be mydomain/project/lib/img, etc. Any help will be greatly appreciated.

    Read the article

  • htaccess mod_rewrite check file/directory existence, else rewrite?

    - by devians
    I have a very heavy htaccess mod_rewrite file that runs my application. As we sometimes take over legacy websites, I sometimes need to support old urls to old files, where my application processes everything post htaccess. My ultimate goal is to have a 'Demilitarized Zone' for old file structures, and use mod rewrite to check for existence there before pushing to the application. This is pretty easy to do with files, by using: RewriteCond %{IS_SUBREQ} true RewriteRule .* - [L] RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L] RewriteCond Public/DMZ/$1 -F [OR] RewriteRule ^(.*)$ Public/DMZ/$1 [QSA,L] This allows pseudo support for relative urls by not hardcoding my base path (I cant assume I will ever be deployed in document root) anywhere and using subrequests to check for file existence. Works fine if you know the file name, ie http://domain.com/path/to/app/legacyfolder/index.html However, my legacy urls are typically http://domain.com/path/to/app/legacyfolder/ Mod_Rewrite will allow me to check for this by using -d, but it needs the complete path to the directory, ie RewriteCond Public/DMZ/$1 -F [OR] RewriteCond /var/www/path/to/app/Public/DMZ/$1 -d RewriteRule ^(.*)$ Public/DMZ/$1 [QSA,L] I want to avoid the hardcoded base path. I can see one possible solutions here, somehow determining my path and attaching it to a variable [E=name:var] and using it in the condition. Another option is using -U, but the tricky part is stopping it from hijacking every other request when they should flow through, since -U is really easy to satisfy. Any implementation that allows me to existence check a directory is more than welcome. I am not interested in using RewriteBase, as that requires my htaccess to have a hardcoded base path.

    Read the article

  • .htaccess Redirect Loop, adding multiple .php extensions

    - by Ryan Smith
    I have sort of a small parent/teacher social network set up for my school. I use my .htaccess file to make the links to teacher profiles cleaner and to add a trailing slash to all urls. I get this problem when going to /teachers/teacher-name/ the link (sometimes) redirects to /teachers/teacher-name.php.php.php.php.php.php.php.php... Below is my .htaccess file. Sometimes if I clear my browser cache in Chrome it temporarily fixes it. I can't exactly wright .htaccess syntax, but I'm pretty familiar with it. Any suggestions are appreciated! RewriteEngine on RewriteBase / #remove php ext RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.php #force trailing slash/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)([^/])$ /$1$2/ [L,R=301] #other rewrites RewriteRule ^teachers/([^/\.]+)/$ /teachers/profile.php?u=$1 RewriteRule ^teachers/([^/\.]+)/posts/$ /teachers/posts.php?u=$1 RewriteRule ^teachers/([^/\.]+)/posts/([^/\.]+)/$ /teachers/post.php?u=$1&p=$2 RewriteRule ^gallery/([^/\.]+)/$ /gallery/album.php?n=$1 RewriteRule ^gallery/([^/\.]+)/slideshow/$ /gallery/slideshow.php?n=$1 RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/([^/\.]+)/$ /gallery/photo.php?a=$1&p=$2&e=$3 EDIT:I have attached a screenshot of exactly what I'm talking about.

    Read the article

  • Codeigniter .htaccess not working in subdirectory

    - by xzdead
    I have this codeingniter project structure webRoot | |/application | | | |/controllers | | | |/admin | |/public | | | |/admin | | | | | |/css | | |/img | |/css | |/img And this is my .htacess file, located in /public. I use this in every local project running xampp: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php </IfModule> It works fine in localhost, but doesn't work in a dreamhost server. I always get "no input file specified". So after searching the web and trying lots of combinations, the best I got is this .htaccess file: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] With this one, if I go to http://development.mydomain.com - I see the codeigniter welcome page But if I go to: http://development.mydomain.com/admin - I see the directory listing of /public/admin and doesn't execute the controller in /application/controllers/admin Again, if I go to: http://development.mydomain.com/admin/admin - I see the private area, it executes the controller and goes to the default controller defined in routes, "dashboard" This works fine too: http://development.mydomain.com/admin/dashboard I have set in my config file: $config['index_page'] = ''; $config['base_url'] = ''; $config['uri_protocol'] = 'AUTO'; I think that whatever is wrong in my .htaccess is causing other path issues I have with my project. Any help would be great. Thanks to all in advance EDIT: I removed this line: RewriteCond %{REQUEST_FILENAME} !-d because admin directory exists, that's why I see the public directory listing. But now I see the codeigniter welcome page when I go to http://development.mydomain.com/admin So now my .htaccess file looks like: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] #RewriteRule ^(.*)$ /index.php?/$1 [L] I also tried with the commented RewriteRule but I get the same result.

    Read the article

  • Stop Rewrite htaccess create random pages

    - by Vistol
    Recently I saw in my Webmaster tools that some random sites are linking to my site. Actually this is not an big issue. The issue comes when the pages that are linked are not real pages because of my httaccess file. This is the htaccess code that Im running: <pre> #Options +FollowSymLinks RewriteEngine on RewriteRule ^([^/\.]+)/?$ index.php?id=$1 [L] RewriteRule ^([0-9]+)/(.*)$ index.php?id=$1 [L] </pre> So the real URLs would be: mysite.com/folder/999/TITLE-OR-NAME But cecause I only check the 1st folder ($1) which is an I numberD, this htaccess file is allowing hackers linking to my site with random URLs like: mysite.com/folder/999/TITLE-OR-NAME1 mysite.com/folder/999/TITLE-OR-NAME2 mysite.com/folder/999/TITLE-OR-NAME3 mysite.com/folder/999/TITLE-OR-NAME4 mysite.com/folder/999/TITLE-OR-NAME5 The worst part comes when google tells me that I am duplicating content!!! Actually I am not duplicating content, the htaccess is duplicating it for me. And yes I know, Im a bad newbie programmer but Id really appreciate your help with this cause Im struggling to find a solution but it never. Thank you very much for all your support to this newbie :)

    Read the article

  • .htaccess - alias all www-only requests to subdirectory

    - by CodeMoose
    Trying to install the wonderful Concrete5 CMS to use as my main site engine - the problem is it has about 15 different files and directories, and they clutter up my root. I'd really like to move it to a /_concrete/ subdirectory, and still maintain it in the domain root. htaccess has never been my strong suit - after a lot of research and learning, and a lot of error 500s, my frustration is overriding my pride and I'm posting here. Here's exactly what I'm trying to accomplish: Any requests that come through www.domain.com are forwarded to www.domain.com/_concrete/, except in the case of an existing file. The end-user URL shouldn't change - they will still see the site as www.domain.com, even though they're being served www.domain.com/_concrete/. Multiple subdomains exist on this site as sub-folders within the root - thus, only requests coming through www.domain.com should be redirected. Here's the closest I got with my htaccess, which produces an error 500: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !^_concrete RewriteRule ^(.*)$ _concrete/$1 [L,QSA] This is the result of 4 hours of sweat and blood (mostly blood), so I have to be close. I'm hoping one of your fine minds can point out a stupid mistake and put this thing to rest swiftly. Thanks for your time! Addendum: I previously posted .htaccess - alias domain root to subfolder a while ago, which got me started. Please don't fall into the trap of thinking it's a duplicate.

    Read the article

  • .htaccess redirect noticably increasing load time

    - by GTCrais
    I set up a SEF link via .htaccess RewriteRule to one of the articles on my website just to see how that works, and it does work but it considerably increases the load time of that particular page. On average the articles (including the one I'm talking about, when not using the rewrite rule) load in about 1.3 seconds. With the rewrite rule, the load time is 3.3 seconds on average until the page displays, and the loader thingy in the firefox tab keeps spinning for another 2 seconds. I have WAMP setup on my computer, and the website is being accessed through no-ip.com. Here is the .htaccess config (very simple, as you can see): Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^o-sw-liji /NewSWL/o-nama.php?body=o-sw-liji In httpd.conf I have this (somewhere I read this might affect the load time for some reason - searching for files through all the directories or something, I don't remember exactly what I read): <Directory /> Options None AllowOverride None Order deny,allow Deny from all </Directory> DocumentRoot "Z:/Program Files (x86)/wamp/www/" <Directory "Z:/Program Files (x86)/wamp/www/"> Options None AllowOverride All Order allow,deny Allow from all </Directory> Any ideas why .htaccess redirect increases the load time by so much? UPDATE: so I put a session based counter in the "o-nama.php" script. Apparently when I access the web via the 'normal' link i.e. 'o-nama.php?body=o-sw-liji', the counter increases by one, as it should - it's one page load. But when the page is accessed through the redirected link, i.e. 'o-nama/o-sharewood-liji' the counter increases by 6-8, which naturally makes the load time a lot longer, since it's loading the same page for 6-8 times. I have no idea why this is happening. Any help is appreciated.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >