Jump to content

Search the Community

Showing results for tags 'htaccess'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 17 results

  1. Hey guys, i've got a webpage which is password safe by htaccess, but i want to change a few things and i'd like to hear your opinions of how i should execute it at the end. What i've got is: you enter the webpage then you have 1 account to login with via htaccess and then you're on the webpage. What i want is: Something more safe than htaccess. That i can add more users with where i can see when they were last online etc. And idk if htaccess is bruteforce safe but i also need that. My plan was to create a landing page with a login mask connected to an sql database, where all the accounts are managed. Plus the landing page will be with google recaptcha or something like that. What i need to know is, is this the best way to handle all this or do you guys recommend something else? Much appreciated Greetings, Merdo
  2. Hi there, I am using a few of re-write rules, the last of which is not working. I assume it clashes with the others in some way? <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^oldurl.co.uk$ [OR] RewriteCond %{HTTP_HOST} ^www.oldurl.co.uk$ RewriteRule (.*)$ http://www.newurl.co.uk/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] RewriteCond %{HTTP_HOST} ^newurl.co.uk$ RewriteRule (.*) http://www.newurl.co.uk/$1 [R=301,L] </IfModule> Any pointers here would be greatly appreciated! Thanks
  3. Hello! I am trying to use htaccess to remove the .html tag and the /folder/ from the URL. Spent hours on google trying to find something that works. If anyone could link me to a working example or help me would be extremely appreciated This is what I have right now: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}.html -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.html [L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+pages/([^\s]+) [NC] RewriteRule ^ %1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (?!^pages/)^(.*)$ /pages/$1 [L,NC] But it does not remove all of the html tags for some reason and I can still see the /folder/. Also I can't view the index file normally anymore it just looks like this:
  4. I'm looking for directives that help solving the problem of redirecting a not existing subdomain towards the www subdomain. I know/guess .htaccess is used, but cant figure out how. My present situation is that existing subdomains are redirected well. I adjusted virtual hosts in this way: <VirtualHost *:80> ServerName mysite.dev ServerAlias mysite.dev *.mysite.dev DocumentRoot X:/wamp/www/TestVirtHost/ <Directory "X:/wamp/www/TestVirtHost/"> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> my etc/hosts file has the following rules *.mysite.dev mysite.dev subdomain_one.mysite.dev subdomain_two.mysite.dev Can some expert explain please what the .htaccess should look like for the problem explained above.
  5. Hi there, Just about to do some redirects and wanted to make sure I was doing it correctly... the old hosting domain old-domain.com, is going to be forwarding to the new hosting domain, new-domain.com. Would I write the rule as follows: Redirect 301 /page-name/ http://www.newdomain.com/page-name or would I have to include the old domain in front of the page name as well? Redirect 301 http://www.old-domain.com/page-name/ http://www.new-domain.com/page-name Thanks
  6. Hi there I'm getting a 500 Internal Server Error when using this .htaccess file: RewriteEngine onRewriteCond $1 !^(index.php|public|forum|robots.txt)RewriteRule ^(.*)$ /ukscifi/test.php [L] Any idea why this is happening?
  7. why this code not workingRewriteEngine onRewriteRule ^media/([^/.]+)/?$ media.php?hal=$1 [L] can you help me
  8. Hi guys, I was wondering whether I could get some assistance with a problem I'm having: I've started looking after my company's website and have recently set up a custom 404 error page for it. My .htaccess file reads: ErrorDocument 404 /404.html The problem I've got is that it's not working properly all the time. When the incorrect URL looks like this: www.companydomain.com/xxx everything works fine, but when an additional forward slash gets added in it stops working properly , for example if the URL looks like www.companydomain.com/xxx/yyy. The 404 goes through, and it tries to load the page, but all of the formatting to the text goes out the window and none of the linked images on the page, such as the header on the top, gets pulled through - instead of the images I get the black box with an X in it. What have I done wrong, and what do I need to do so that the correct 404 error page comes up for any combination put after the domain name. If anyone has any suggestions i'd be very grateful. Thanks!
  9. I have remade my company webpage using very little php mostly because I don't know it however the last web designer seemed to love it and now all the links that are out in the big www start with "?p=" and I can't do a 301 redirect on those pages. how do I rewrite those links as they are coming in to change ?p=page to page/php so I can properly redirect them in my htaccess file. Redirect 301 /?p=oldpage http://www.mypage.com/newpage.php/ won't redirectRedirect 301 /oldpage.php http://www.mypage.com/newpage.php/ will redirect I found this in his index.php file and I think thats what he used to change the .php to ?p= $page = (isset($_GET['p']) ? $_GET['p'] : $homePage);$page = basename($page);$page = str_replace(".php","",$page);if(!file_exists($page . '.php')){$page = $errorPage;
  10. Hello, im not sure where to post this, but this prob would be htaccess question. How i can only allow users to go: http://innostus.info/ only with that domain, but not from my website subfolder: http://mudsaf.info/innostus_ky/Access:'>http://mudsaf.info/innostus_ky/Access: http://innostus.info/Deny access: http://mudsaf.info/innostus_ky/
  11. Hey Everyone! I want to hide my original URL to my dummy URL using htaccess. If i open www.abc.com it shows/opens www.xyz.com and the URL remains the same like www.abc.com. How can i do this, please help me.....
  12. Hey, im wondering is it possible to prevent user to go straight to example scripts/php/myscript1.php, but allowed to include with php. <?php// Example index.phpinclude 'scripts/php/myscript1.php';?>
  13. I got a gig helping to get this site running on wordpress, and I cannot figure out why most pages redirect to the homepage. The htaccess doesn't have anything but wordpress stuff in it. This is the site:http://capecodwithinreach.com/ Notice, if you type anything after that, like the pages i am trying to create, it redirects home.http://capecodwithin...com/newpage.phphttp://capecodwithin...still-redirects However, things like:http://capecodwithin...om/wp-login.phpstill go to the right place. Why is this, and how can I stop it? I can't create any pages! Thanks!
  14. It's difficult nowadays to find a good htaccess tutorial on the internet. Since W3Schools makes awesome tutorials on basically everything else on web design and development, I think it would be an awesome idea for you guys to add some htaccess tutorials to your knowledge base. I'm sure there would be plenty of people that would use these.
  15. Hi there,I am breaking my head to a htaccess issue. I am trying to rewrite my dynamic urls, which works fine. However, when I enter the old url the browser is not redirecting the old url to the new url.This is the code I am using:RewriteRule ^([a-zA-Z0-9-z\-]+)/$ search.php?a=$1RewriteRule ^([a-zA-Z0-9-z\-]+)$ search.php?a=$1For example; if one enters domain.com/search?a=word the url should transform to domain.com/word.Is there anyway who can help me with the redirect part?Thanks in advance! I tried like 1000 tutorials but they all just rewrite the url and do not redirect the old url to the new one.
  16. I have a simple RewriteRule in my .htaccess file: RewriteEngine OnRewriteRule ^broadcasts/?$ broadcasts.php?action=view&page=1 The problem is that the browser is showing this when I visit /broadcasts: /broadcasts/?action=view&page=1 I am completely stumped because nothing like this has ever happened to me before. Any ideas or solutions?
  17. Hi there I have mod_rewrite installed on my apache server, I've successfully got some rewrite rules working but one is just not working! I have a search box that produces a url like this: /search/query-here I have a page called search.php which accepts query strings like q=query-here Here is my rewrite rule that works on my site locally: www-mysite.com:8888 RewriteRule ^search/(.*)$ search\.php?q=$1 Although my search.php is being hit/loaded, no query string is being passed to my live version. When I echo $_SERVER['SCRIPT_FILENAME']. "?".$_SERVER["QUERY_STRING"]; out I get: LOCAL: /search.php?q=aa LIVE: /search.php? Any ideas what I can do?
  • Create New...