Jump to content

Search the Community

Showing results for tags 'htaccess'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 16 results

  1. htaccess rule not working

    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
  2. .htaccess help

    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:
  3. 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 127.0.0.1 *.mysite.dev mysite.dev 127.0.0.1 subdomain_one.mysite.dev 127.0.0.1 subdomain_two.mysite.dev Can some expert explain please what the .htaccess should look like for the problem explained above.
  4. .htaccess redirect

    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
  5. htaccess giving 500 response

    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?
  6. ht access

    why this code not workingRewriteEngine onRewriteRule ^media/([^/.]+)/?$ media.php?hal=$1 [L] can you help me
  7. 404 .htaccess problem

    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!
  8. 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;
  9. Prevent address from certain domain

    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/
  10. 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.....
  11. 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';?>
  12. 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!
  13. HTAccess Tutorials

    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.
  14. Htaccess - rewrite and redirect

    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.
  15. Queer Rewriterule Problem

    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?
  16. 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?
×