Search Results

Search found 1374 results on 55 pages for 'rewriterule'.

Page 7/55 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • RewriteCond and Full QUERY_STRING

    - by Tim
    I'm having hard time getting my head wrapped around this one - and it should be trivial. I would like to redirect one URL with a specific query string to another URL. I want to send any requests that contain the query string in the URL http://mysite.com/index.php?option=com_user&view=register To: http://mysite.com/index.php?option=com_regme&view=form&regme=4&random=0&Itemid=6 If they add anything to the end of the first URL, it should still go to the second URL so that they cannot bypass the redirection. Nothing in the first query string needs to be preserved and passed to the second - all I want to do is change the URL completely. I'm tearing my hair out trying to get this to work yet it should be trivial. Suggestions? Thanks, -Tim

    Read the article

  • 404 Error on a file that exists?

    - by Abs
    Hello all, A script makes a GET request to my URL like so: http://mydomain.com/cgi-bin/uu_ini_status_audios.pl?tmp_sid=b742be1d131c4d32237a9f1fcdca659e&rnd_id=0.2363453360320319 However, I get a 404 returned straight away: The requested URL /cgi-bin/uu_ini_status_audios.pl was not found on this server. But that script exists on my server, I can see the file! It has the correct permissions (I gave it a 777 to be sure). It is also owned by my apache user and its in the group apache. What am I missing?? Thanks for any help on this! Update I thought it would have been a htaccess (rewrite) but I don't think it is anymore. I tried putting a index.php file in there and try to access it via my URL but I can't even do that! I tried this: http://mydoamin.com/cgi-bin/index.php - same 404 error! I get this in myerror log: [Tue Sep 14 14:42:49 2010] [error] [client xx.xxx.xx.xxx] script not found or unable to stat: /var/www/vhosts/mydomain.com/cgi-bin Access_log file: xx.xxx.xx.xxx - - [14/Sep/2010:14:48:25 +0200] "GET /cgi-bin/index.php HTTP/1.1" 404 475 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)" Update 2 My htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^blog/ - [L] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L] RewriteRule ^search/(.*)/(.*)/(.*)/(.*) /search.php?searchfor=$1&sortby=$2&page=$3&searchterm=$4 RewriteRule ^confirmemail/(.*) /confirmemail.php?code=$1 RewriteRule ^resetpassword/(.*) /resetpassword.php?code=$1 RewriteRule ^resendconfirmation/(.*) /resendconfirmation.php?userid=$1 RewriteRule ^categories/ /categories.php RewriteRule ^([-_~*a-zA-Z0-9]+)(\/)?$ /memberprofile.php?username=$1 RewriteRule ^browse/audios/(.*)/(.*)/(.*)/(.*) /audios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^browse/categories/audios/(.*)/(.*)/(.*)/(.*) /categoryaudios.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^audios/(.*)/(.*) /playaudio.php?audioid=$1&title=$2 RewriteRule ^download/audio/(.*)/(.*) /downloadaudio.php?AUDIOID=$1&title=$2 RewriteRule ^members/audios/(.*)/(.*) /memberaudios.php?pid=$1&username=$2 RewriteRule ^syndicate/audios/(.*)/(.*) /syndicateaudios.php?filter=$1&title=$2 </IfModule> Update 3 [root@smydomain ~]# ls -la /var/www/vhosts/mydoamin.com/httpdocs/cgi-bin/ total 60 drwxr-xr-x 3 apache root 4096 Sep 14 14:37 . drwxr-x--- 20 som psaserv 4096 Sep 14 14:40 .. drwxr-xr-x 2 apache root 4096 Sep 7 03:01 configs -rwxrwxrwx 1 apache root 4 Sep 14 14:37 index.php -rwxrwxrwx 1 apache apache 6520 Sep 7 03:01 uu_ini_status_audios.pl -rwxr-xr-x 1 apache root 3215 Sep 7 03:01 uu_lib_audios.pl -rwxr-xr-x 1 apache root 30249 Sep 7 03:01 uu_upload_audios.pl

    Read the article

  • .htaccess twitter or facebook URL naming convention

    - by Mike Silvis
    For my Social Networking Site, I would like to build a facebook, or twitter similar URL rewriting naming convention. Using Twitter as an example, they have pages labeled twitter.com/about and another page labeled twitter.com/{$username} However, how do you differentiate between say a user who has registers on to our site as "about" then. From this we are going to have a server conflict between the user "about" and the page about. What is the best way to handle this?

    Read the article

  • Lighttpd rewriting files and directories

    - by Ronald
    I'm trying to do url rewriting with Lighttpd. I have what I need partially working. Right now I have this: http://domain.com/name/a/123 which rewrites to http://domain.com/name/a.php?pid=123 I do this with this rewrite-once rule: "^/name/a/([^/]+)"= "/name/a.php?pid=$1" That php page has external resources that are not getting rewritten such as the JavaScript and CSS files. Is there a way I can also have the rewrite do the following? http://domain.com/name/a/js/file.js = http://domain.com/name/js/file.js

    Read the article

  • Jetty RewriteHandler and RewriteRegexRule

    - by Justin
    I'm trying to rewrite a URL for a servlet. The URL gets rewritten correctly, but the context doesn't match after that. Any idea how to get this to work? RewriteHandler rewriteHandler = new RewriteHandler(); rewriteHandler.setRewriteRequestURI(true); rewriteHandler.setRewritePathInfo(true); rewriteHandler.setOriginalPathAttribute("requestedPath"); RewriteRegexRule rewriteRegexRule = new RewriteRegexRule(); rewriteRegexRule.setRegex("/r/([^/]*).*"); rewriteRegexRule.setReplacement("/r?z=$1"); rewriteHandler.addRule(rewriteRegexRule); ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection(); Context servletContext = new Context(contextHandlerCollection, "/"); servletContext.addServlet(new ServletHolder(new RedirectServlet()), "/r"); So basically /r/asdf gets rewritten to /r?z=asdf. However, the rewritten /r?z=asdf is now not processed by the servlet. Also, /r?z=asdf does work if called directly.

    Read the article

  • Case Insensitive URLs with mod_rewrite

    - by Paul Tarjan
    I'd like for any url that doesn't hit an existing file, to do a lookup on the other possible cases and see if those files exist, and if so, 302 to them. If that's not possible, then I'm ok with these compromises: Only check the lowercase version Only check the first path portion For example http://example.com/CoOl/PaTH/CaMELcaSE should redirect to http://example.com/cool/path/camelCase (assuming the latter exists). but of course a full solution is much more useful to me and others

    Read the article

  • How to rewrite image/<text>-<imageID>-<text> to image/ID.jpg ???

    - by SilverRuby
    HI, I used to have PHP websites and using url rewriting on picture to have SEO friendly urls, On php I had links like /image/blablablabla-1234-blablabla rewriting to: /image/1234.jpg by using a url rewrite rule on apache .htaccess file. Now I totally switched to ruby on rails and I would like to know what is the best way to do that on RoR? I am hosting websites on apache with passenger. Thanks in advance

    Read the article

  • Help with redirect and query strings

    - by James
    I'm a total novice at mod rewrite so I'll try and present my question as clearly as possible: I'm trying to create a url redirect of the following (static) affiliate url that can append it self to any product links after using a query string: affiliate url: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1= product url: hxxp:// example.domain.com What I want to achieve is redirecting the affiliate code as below and being able to add dynamic product urls after as the following examples show: rewritten affiliate url: hxxp://domain.com/go affiliate url + product url: hxxp://domain.com/go?=http://example.domain.com redirects to: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=http://example.domain.com

    Read the article

  • How many rewrite rules should I expect to manage?

    - by Scott Ackerson
    I'm dealing with a hosting team that is fairly skiddish of managing many rewrite rules. What are your experiences with the number of rules your sites are currently managing? I can see dozens (if not more) coming up as the site grows and contracts and need to set expectations that this isn't out of the norm. Thanks

    Read the article

  • How to rewrite a URL with %23 in it?

    - by Jan P.
    I have a (wordpress) blog where after commenting the users are redirected back to the page with an anchor to their comment. Should look like this: http://example.org/foo-bar/#comment-570630 But somehow I get a lot of 404 ins my logfiles for such URLs: http://example.org/foo-bar/%23comment-570630 Is there a way to write a .htaccess rewrite rule to fix this? Bonus question: Any idea why this happens and what I can do about it?

    Read the article

  • PHP .htaccess issue, specific/dynamic keywords

    - by Kunal
    Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule ^land-products$ products.php?type=land RewriteRule ^payment-methods$ payment-methods.php RewriteRule ^withdrawal-methods$ withdrawal-methods.php RewriteRule ^deposit-methods$ deposit-methods.php RewriteRule ^product-bonuses$ product-bonuses.php RewriteRule ^law-and-regulations$ law-and-regulations.php RewriteRule ^product-news$ product-news.php RewriteRule ^product-games$ product-games.php RewriteRule ^no-products$ no-products.php RewriteRule ^page-not-found$ notfound.php RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^casinos/(.*)$ product.php?id=$1 RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ cms.php?link=$1 ErrorDocument 404 /notfound.php What I am trying to achive here is that the first set of rules apply to some specific keywords which should redirect to specific hard coded pages. But anything else parat from those keywords should redirect to cms.php as a parameter as you can see. But the problem is that every keyword is getting redirected to cms.php. Whereas I want any other keyword apart from which are already hard coded in .htaccess file should go cms.php. Not just every keyword. Example: www.sitename.com/online-products -> www.sitename.com/products.php?type=online www.sitename.com/about-the-website -> www.sitename.com/cms.php?id=about-the-website www.sitename.com/product-news -> www.sitename.com/product-news.php Also another issue I am facing is I can not use any keyword with space. Like "online-products" is fine, but I can't use "online products". Please help me out with your expert knowledge. Many thanks in advance for your kind help. Appreciate it.

    Read the article

  • My site not directing links correctly.

    - by mystycs
    I have a site at http://badassmonkeys.com/ and when i click any of the links it does not direct it to the actual page but still pulls up the link. For some reason it works perfectly on linux cpanel and actually loads the pages, but on windows in apache, or in IIS even with a rewrite mod for it, it just doesnt work. The links dont go correctly. Is it a php.ini setting? This is my htaccess file if curious, but it works perfect in linux, but not on windows.... DirectoryIndex index.html index.htm default.htm index.php Options +FollowSymlinks RewriteEngine on RewriteRule ^(.*\.(css|swf|js|xml|gif|jpg))$ $1 [L,QSA,NE] RewriteRule ^((images|contactus|css|blog|script|style|docs|admin|fck|swf|Scripts|includes|images|img|uploads|templates|js|css|calendar|expert_area|fckfiles|flvplayer|highslide)/.*) $1 [L,QSA,NE] RewriteRule ((fb_login|phpinfo|aim|csql|info|cron|index|site|simg|img|ajax|ari|fck_install|ffmpeg_test|file|redirect|rss_blogs|rss_info)\.php) $1 [L,QSA,NE] RewriteRule ^ajax/?$ ajax.php [L,QSA,NE] RewriteRule ((xd_receiver)\.htm) $1 [L,QSA,NE] RewriteRule ((google7a9ea27ccf395e97)\.html) $1 [L,QSA,NE] RewriteRule ((favicon)\.ico) $1 [L,QSA,NE] RewriteRule ((W4uFNrPc9U9SAfP7qiJFwCfp7vk)\.txt) $1 [L,QSA,NE] RewriteRule ^(.*)$ index.php?htaccesss=%{HTTP_HOST}%{REQUEST_URI} [L,QSA,NE]

    Read the article

  • want to make my pages end with HTML

    - by user41997
    here is my current .htaccess For security reasons, Option followsymlinks cannot be overridden. Options +FollowSymlinks Options +SymLinksIfOwnerMatch ErrorDocument 404 /404.php RewriteEngine on rewritecond %{http_host} ^jugep.com [nc] rewriterule ^(.*)$ http://www.jugep.com/$1 [r=301,nc] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^peliculas/([^/]+)$ pelicula.php?pelicula=$1 [L] RewriteRule ^descargar/([^/]+)$ descargar.php?descargar=$1 [L] RewriteRule ^peliculas$ peliculas.php [L] RewriteRule ^peliculas/$ peliculas.php [L] RewriteRule ^buscar$ buscar.php [L] RewriteRule ^buscar/$ buscars.php [L] RewriteRule ^contactar$ contactar.php [L] RewriteRule ^contactar/$ contactars.php [L] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Can someone help me out here, I would like my links to end with a HTML for every link currently a link on my site looks like this (http://www.jugep.com/peliculas/Casino_Royale) I would like it to look like this(http://www.jugep.com/peliculas/Casino_Royale.html) any help is greatly apreciated

    Read the article

  • How can I avoid an error in this .htaccess file?

    - by mipadi
    I have a blog. The blog is stored under the /blog/ prefix on my website. It has the usual URLs for a blog, so articles have URLs in the format /blog/:year/:month/:day/:title/. First and foremost, I want to automatically redirect visitors to the www subdomain (in case they leave that off), and internally rewrite the root URL to /blog/, so that the front page of the blog appears on the front page of the site. I have accomplished that with the following set of rewrite rules in my .htaccess file: RewriteEngine On # Rewrite monkey-robot.com to www.monkey-robot.com RewriteCond %{HTTP_HOST} ^monkey-robot\.com$ RewriteRule ^(.*)$ http://www.monkey-robot.com/$1 [R=301,L] RewriteRule ^$ /blog/ [L] RewriteRule ^feeds/blog/?$ /feeds/blog/atom.xml [L] That works fine. The problem is that the front page of the blog now appears at two distinct URLs: / and /blog/. So I'd like to redirect the /blog/ URL to the root URL. Initially I tried to accomplish this with the following set of rewrite rules: RewriteEngine On # Rewrite monkey-robot.com to www.monkey-robot.com RewriteCond %{HTTP_HOST} ^monkey-robot\.com$ RewriteRule ^(.*)$ http://www.monkey-robot.com/$1 [R=301,L] RewriteRule ^$ /blog/ [L] RewriteRule ^blog/?$ / [R,L] RewriteRule ^feeds/blog/?$ /feeds/blog/atom.xml [L] But that gave me an infinite redirect (maybe because of the preceding rule?). So then I tried this set: RewriteEngine On # Rewrite monkey-robot.com to www.monkey-robot.com RewriteCond %{HTTP_HOST} ^monkey-robot\.com$ RewriteRule ^(.*)$ http://www.monkey-robot.com/$1 [R=301,L] RewriteRule ^$ /blog/ [L] RewriteRule ^blog/?$ http://www.monkey-robot.com/ [R,L] RewriteRule ^feeds/blog/?$ /feeds/blog/atom.xml [L] But I got a 500 Internal Server Error with the following log message: Invalid command '[R,L]', perhaps misspelled or defined by a module not included in the server configuration What gives? I don't think [R,L] is a syntax error.

    Read the article

  • .htaccess rewrite rule to ignore a directory

    - by Kirk Strobeck
    I am running a Symphony installation out of the directory symphony but I want to remove that word from the URL in specific cases. When a user visits http://domain.com/demo It should go to http://domain.com/symphony/demo because I've added a specific rule for demo. If I haven't added a specific rule for demo in the .htaccess, then it should resolve to http://domain.com/demo as typed. This will route it to another part of our app. Here is my current rewrite rule ### Symphony 2.3.x ### Options +FollowSymlinks -Indexes <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / ### SECURITY - Protect crucial files RewriteRule ^manifest/(.*)$ - [F] RewriteRule ^workspace/(pages|utilities)/(.*)\.xsl$ - [F] RewriteRule ^(.*)\.sql$ - [F] RewriteRule (^|/)\. - [F] ### DO NOT APPLY RULES WHEN REQUESTING "favicon.ico" RewriteCond %{REQUEST_FILENAME} favicon.ico [NC] RewriteRule .* - [S=14] ### IMAGE RULES RewriteRule ^image\/(.+\.(jpg|gif|jpeg|png|bmp))$ extensions/jit_image_manipulation/lib/image.php?param=$1 [B,L,NC] ### CHECK FOR TRAILING SLASH - Will ignore files RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !/$ RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ $1/ [L,R=301] ### URL Correction RewriteRule ^(symphony/)?index.php(/.*/?) $1$2 [NC] ### ADMIN REWRITE RewriteRule ^symphony\/?$ index.php?mode=administration&%{QUERY_STRING} [NC,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^symphony(\/(.*\/?))?$ index.php?symphony-page=$1&mode=administration&%{QUERY_STRING} [NC,L] ### FRONTEND REWRITE - Will ignore files and folders RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*\/?)$ index.php?symphony-page=$1&%{QUERY_STRING} [L] </IfModule> ###### How would I change the rewrite rule to support those cases?

    Read the article

  • one page over 9 different urls

    - by Ali Demirtas
    Hi I am using prestashop as the cart for my website. I have a problem; the website used to be in dynamic urls. I enabled friendly url writing. The problem is that one page has more than one url. You can access a same page from the dynamic url and static url. In fact a single page has 9 different urls. This obviously creates problems for seo as search engines penalize my website for this. Here are examples of a page with more than 2 urls (http://www.turkishfootballstore.com/lang-nl/product.php?id_product=515) (http://www.turkishfootballstore.com/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) (http://www.turkishfootballstore.com/lang-nl/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) you can see even the static url's have 2 one with language defined and the other without. out fo the three urls above the correct one is the one at the bottom. What can I do to solve this problem? I have no knowledge of programming. Here is the htaccess for the website. Any sample code or help is really appreciated. There is 550 pages and every page is published in 17 different languages I want to use a 301 auto redirect. What is the simplest way to do it? I have no idea of coding. # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] # Catch 404 errors ErrorDocument 404 /404.php Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^***.com [NC] RewriteRule ^(.*)$ http://www.***.com/$1 [L,R=301] Options +FollowSymLinks RewriteEngine on # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L] Header set Cache-Control: "no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"

    Read the article

  • one page has 9 urls. I am looking for 301 auto redirect syntax for multiple urls.

    - by Ali Demirtas
    Hi This is the third time I am asking this question. I am only looking for the syntax of how to solve this problem. I am using prestashop as the cart for my website. I have a problem; the website used to be in dynamic urls. I enabled friendly url writing. The problem is that one page has more than one url. You can access a same page from the dynamic url and static url. In fact a single page has 9 different urls. This obviously creates problems for seo as search engines penalize my website for this. Here are examples of a page with more than 2 urls (http://www.turkishfootballstore.com/lang-nl/product.php?id_product=515) (http://www.turkishfootballstore.com/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) (http://www.turkishfootballstore.com/lang-nl/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) you can see even the static url's have 2 one with language defined and the other without. out fo the three urls above the correct one is the one at the bottom. What can I do to solve this problem? I have no knowledge of programming. Here is the htaccess for the website. Any sample code or help is really appreciated. There is 550 pages and every page is published in 17 different languages I want to use a 301 auto redirect. What is the simplest way to do it? Please only reply if you have the coding for a auto 301 redirect! URL rewriting module activation RewriteEngine on URL rewriting rules RewriteRule ^([a-z0-9]+)-([a-z0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)-([0-9]+)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]).jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-])/([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$3&isolang=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$2&isolang=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-])(.)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-])/([0-9]+)-([a-zA-Z0-9-]).html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)-([a-zA-Z0-9-])(.)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)-([a-zA-Z0-9-])(.)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-])(.)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-])(.)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] Catch 404 errors ErrorDocument 404 /404.php Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^.com [NC] RewriteRule ^(.)$ http://www.*.com/$1 [L,R=301] Options +FollowSymLinks RewriteEngine on index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.index.php\ HTTP/ RewriteRule ^(.)index.php$ /$1 [R=301,L] Header set Cache-Control: "no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"

    Read the article

  • Getting problem in removing end slash from directory

    - by user2615947
    this is my code but i tried many ways but it is not working and i am not able to remove the end slash from the directory RewriteEngine On RewriteBase / # remove enter code here.php; use THE_REQUEST to prevent infinite loops RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP RewriteRule (.*)\.php$ $1 [R=301] # remove index RewriteRule (.*)/index$ $1/ [R=301] # remove slash if not directory RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} /$ RewriteRule (.*)/ $1 [R=301] # add .php to access file, but don't redirect RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] # Remove trailing slashes RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L] Thanks

    Read the article

  • Why is this mod_rewrite RewriteRule directive not working in the .htaccess file?

    - by morgant
    I've got a site that was hosted on a linux el cheapo hosting service that I'm migrating to my Mac OS X 10.5 Leopard Server server running Apache 2.2.8 & PHP 5.2.5 w/rewrite_module enabled and AllowOverride All, but I'm running into an issue with the following lines in the .htaccess file: RewriteEngine On #RewriteRule ^view/([^/\.]+)/?$ /view.php?item=$1 [L] #RewriteRule ^order/([^/\.]+)/?$ /order.php?item=$1 [L] RewriteRule ^category/([^/\.]+)/?$ /category.php?category=$1 [L] As you can see, I've commented out the RewriteRule directives for /view/ and /order/, so I'm only dealing with /category/. When I attempt to load http://domain.tld/category/2/ it runs category.php (I've added debug code to confirm), but $_SERVER['REQUEST_URI'] comes through as /category/2/ and $_GET['category'] comes through as empty. I'm usually fine with troubleshooting .htaccess files and mod_rewrite directives, but this one's got me stumped for some reason. Update: I followed Josh's suggestion and here's the what's dumped to mod_rewrite.log when I try to access http://domain.tld/category/2/: 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (2) init rewrite engine with requested uri /category/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) applying pattern '.*' to uri '/category/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (1) pass through /category/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] add path info postfix: /Library/WebServer/Documents/tld.domain.www/category.php -> /Library/WebServer/Documents/tld.domain.www/category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/category.php/13 -> category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri 'category.php/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/category.php 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] add path info postfix: /Library/WebServer/Documents/tld.domain.www/category.php -> /Library/WebServer/Documents/tld.domain.www/category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/category.php/13 -> category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri 'category.php/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/category.php 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (2) init rewrite engine with requested uri /13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) applying pattern '.*' to uri '/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (1) pass through /13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/13 -> 13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri '13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/13

    Read the article

  • Why is this mod_rewrite RewriteRule directive not working in the .htaccess file?

    - by morgant
    I've got a site that was hosted on a linux el cheapo hosting service that I'm migrating to my Mac OS X 10.5 Leopard Server server running Apache 2.2.8 & PHP 5.2.5 w/rewrite_module enabled and AllowOverride All, but I'm running into an issue with the following lines in the .htaccess file: RewriteEngine On #RewriteRule ^view/([^/\.]+)/?$ /view.php?item=$1 [L] #RewriteRule ^order/([^/\.]+)/?$ /order.php?item=$1 [L] RewriteRule ^category/([^/\.]+)/?$ /category.php?category=$1 [L] As you can see, I've commented out the RewriteRule directives for /view/ and /order/, so I'm only dealing with /category/. When I attempt to load http://domain.tld/category/2/ it runs category.php (I've added debug code to confirm), but $_SERVER['REQUEST_URI'] comes through as /category/2/ and $_GET['category'] comes through as empty. I'm usually fine with troubleshooting .htaccess files and mod_rewrite directives, but this one's got me stumped for some reason. Update: I followed Josh's suggestion and here's the what's dumped to mod_rewrite.log when I try to access http://domain.tld/category/2/: 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (2) init rewrite engine with requested uri /category/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) applying pattern '.*' to uri '/category/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (1) pass through /category/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] add path info postfix: /Library/WebServer/Documents/tld.domain.www/category.php -> /Library/WebServer/Documents/tld.domain.www/category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/category.php/13 -> category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri 'category.php/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6aa98/subreq] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/category.php 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] add path info postfix: /Library/WebServer/Documents/tld.domain.www/category.php -> /Library/WebServer/Documents/tld.domain.www/category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/category.php/13 -> category.php/13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri 'category.php/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b5ea98/initial] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/category.php 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (2) init rewrite engine with requested uri /13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) applying pattern '.*' to uri '/13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (1) pass through /13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] strip per-dir prefix: /Library/WebServer/Documents/tld.domain.www/13 -> 13 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (3) [perdir /Library/WebServer/Documents/tld.domain.www/] applying pattern '^category/([^/\.]+)/?$' to uri '13' 65.19.81.253 - - [22/Oct/2009:17:31:53 --0400] [domain.tld/sid#100aae0b0][rid#100b6ea98/subreq] (1) [perdir /Library/WebServer/Documents/tld.domain.www/] pass through /Library/WebServer/Documents/tld.domain.www/13

    Read the article

  • .htaccess to nginx rewite

    - by Deepak
    please help me with changing this .htaccess to rginx rewite RewriteRule ^show.php/(.*)$ show2.php?img=$1 [L] RewriteRule ^out.php/([a-z]{1})(.*)$ out2.php?$1=$2&%{QUERY_STRING} [L] RewriteRule ^view.php/(.)$ view2.php?img=$1 [L] RewriteRule ^images.php/([a-z]{1})(.)$ images2.php?$1=$2&%{QUERY_STRING} [L] RewriteRule ^gallery/([0-9]+)-([^/])/(.)$ gallery.php?gal=$1&img=$3 [L] RewriteRule ^view/([0-9]+)-([^/])/(.)$ gallery_body.php?gal=$1&img=$3 [L]

    Read the article

  • Combining Two .htaccess files .. Wordpress and OSCommerce SEO URL's

    - by William Langford
    I Googled over and over and got no where so I figured I would give this a try.. I have OSCommerce in my httpdocs directory. Then I have /wordpress but changed the blog location to /blog.php with some mods. Works great. Now to add SEO URL's from Wordpress to my OSC htaccess OSC htaccess; Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.)-p-(.).html$ product_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.)-c-(.).html$ index.php?cPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING} RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING} RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING} Wordpress htaccess RewriteBase /blog.php/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog.php/index.php [L] Is this even possible with two RewriteBase files? I looked at a way to do it with directory defines but didn't think it was possible as blog.php isn't a directory. Thanks!

    Read the article

  • htaccess - Redirects with more than 1 level deep not working

    - by barfoon
    Hey everyone, Just moved to shared hosting on GoDaddy and Im trying to get my .htaccess rules working. Heres what I have: ErrorDocument 404 /error.php Options FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.mydomain\.org$ RewriteRule ^(.*)$ http://mydomain.org/$1 [R=301,L] RewriteRule ^view/(\w+)$ viewitem.php?itemid=$1 [R=301,L] RewriteRule ^category/(\w+)$ viewcategory.php?tag=$1 [R=301,L] RewriteRule ^faq$ faq.php RewriteRule ^about$ about.php RewriteRule ^contact$ contact.php RewriteRule ^submit$ submit.php RewriteRule ^contactmsg$ handler-contact.php All the pages @ the root of the domain seem to be working i.e mydomain.org/faq, mydomain.org/about are working. But whenever I try mydomain.org/category/somecategory, I get a 404. How can I fix my .htaccess to obey these rules that are more than 1 level deep? Thanks,

    Read the article

  • configuration issue with respect to .htaccess file on ubuntu

    - by Registered User
    I am building an application tshirtshop I have following configuration in /etc/apache2/sites-enabled/tshirtshop <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/tshirtshop <Directory /var/www/tshirtshop> Options Indexes FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> and following in .htaccess file in location /var/www/tshirtshop/.htaccess <IfModule mod_rewrite.c> # Enable mod_rewrite RewriteEngine On # Specify the folder in which the application resides. # Use / if the application is in the root. RewriteBase /tshirtshop #RewriteBase / # Rewrite to correct domain to avoid canonicalization problems # RewriteCond %{HTTP_HOST} !^www\.example\.com # RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] # Rewrite URLs ending in /index.php or /index.html to / RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html?)\ HTTP RewriteRule ^(.*)index\.(php|html?)$ $1 [R=301,L] # Rewrite category pages RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/page-([0-9]+)/?$ index.php?DepartmentId=$1&CategoryId=$2&Page=$3 [L] RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/?$ index.php?DepartmentId=$1&CategoryId=$2 [L] # Rewrite department pages RewriteRule ^.*-d([0-9]+)/page-([0-9]+)/?$ index.php?DepartmentId=$1&Page=$2 [L] RewriteRule ^.*-d([0-9]+)/?$ index.php?DepartmentId=$1 [L] # Rewrite subpages of the home page RewriteRule ^page-([0-9]+)/?$ index.php?Page=$1 [L] # Rewrite product details pages RewriteRule ^.*-p([0-9]+)/?$ index.php?ProductId=$1 [L] </IfModule> the site is working on localhost and is working as if there is no .htaccess rule specified i.e. if I were to view a page as http://localhost/tshirtshop/nature-d2 then I get a 404 Error but if I view the same page as http://localhost/tshirtshop/index.php?DepartmentId=2 then I can view it. sudo apache2ctl -M Loaded Modules: core_module (static) log_config_module (static) logio_module (static) mpm_prefork_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) mime_module (shared) negotiation_module (shared) php5_module (shared) reqtimeout_module (shared) rewrite_module (shared) setenvif_module (shared) status_module (shared) Syntax OK What is the mistake if any one can point out in above configuration, or else I need to check any thing else?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >