rewrite

Lighttpd rewrite for Wordpress inside CakePHP

不羁的心 提交于 2019-12-12 03:11:09
问题 I'm having problems to setup Lighttpd rewrite rule for a Wordpress instalation that is located inside a CakePHP app. The folder structure looks like this: var/ www/ app/ webroot/ blog/ cake/ vendors/ The cakePHP app works fine. If I try to access http://domain.tld , it loads the app front page. Any attempt to access a controller/action also works fine. The problem happens when I try to load any wordpress post. The url structure to access a WP post is this: http://domain.tld/blog/post/post

301 Redirect/Rewrites with Patterns

强颜欢笑 提交于 2019-12-12 02:48:01
问题 I know using the power of regex, I can reduce my 301's into a few lines. However, I do not have the brain power for it. Basically our links went from: http://www.site.com/collection/womens-active (this can also have ?brand=123 queries attached to the end) To: http://www.site.com/collection/active "womens-" is the changed part. A simple 301 works perfectly, even with queries, but there is about 100 lines for this in htaccess. With Regex, can we reduce this to a few lines? 回答1: Use a

URL Rewrite Module Questions

痞子三分冷 提交于 2019-12-12 02:26:10
问题 I want to make a rewrite module in htaccess file something like below http://example.com/index.php?tel=604-567-0909&cat=1&sort=2 to http://example.com/604-567-0909/?cat=1&sort=2 so $_GET will be $_GET[tel] = 604-567-0909 $_GET[cat] = 1 $_GET[sort] = 2 How would this rule look like? 回答1: It would look like this if you only wanted to accept numbers and dashes in the tel field: RewriteRule ^/?([0-9\-]+)/$ index.php?tel=$1 [L] The other values in the query string would be carried over

Use htaccess to rewrite subdomain files to a folder

蓝咒 提交于 2019-12-12 02:07:31
问题 I need to rewrite a files on subdomain to files stored in the folder with name of the subdomain. Only files that start with sitemap should be rewritten. So, if the requests look like this: http://demo.domain.com/sitemap.xml http://demo.domain.com/sitemap_more.xml http://test.domain.com/sitemap.xml http://test.domain.com/sitemap_alpha.xml These should rewrite to files: /content/sitemaps/demo/sitemap.xml /content/sitemaps/demo/sitemap_more.xml /content/sitemaps/test/sitemap.xml /content

Magento not recognizing custom Topmenu.php

依然范特西╮ 提交于 2019-12-12 01:52:40
问题 I have built a custom module to enable changing the Topmenu link text based on a custom attribute in the backend. The module was tested on Magento CE 1.7.02 and works 100%. Now I am testing on Magento EE 1.12.02 and the menu is not recognizing the rewritten Topmenu class (As-in, I can remove everything from the file, and/or mis-spell the class name in the XML and there are no errors, and the site loads fine). Something tells me that Enterprise Edition pulls this menu from a different location

github url style

≯℡__Kan透↙ 提交于 2019-12-12 01:32:42
问题 I wanted to have users within my website to have their own URL like http://mysite.com/username (similar to GitHub, e.g. my account is http:// github. com/sr3d). This would help with SEO since every profile is under the same domain, as apposed to the sub-domain approach. My site is running on Rails and Nginx/Passenger. Currently I have a solution using a bunch of rewrite in the nginx.conf file, and hard-coded controller names (with namespace support as well). I can share include the nginx.conf

Javascript with Apache 2 Proxy rewrite rules and Plone

大兔子大兔子 提交于 2019-12-12 00:53:34
问题 I have a Plone site behind and Apache2 Proxy server that has two web pages that uses a java script. That Plone site and Java Script functions correct with out that Apache 2 Proxy Server. Plone does function correctly with it's web Plone pages behind the proxy server. However the JavaScript is not working correctly with the Apache proxy servers. Please see below Apache access logs. I believe the reason has to with the Javascript try to post to the wrong location. If you look at the GET

.htaccess Redirect based on HTTP_REFERER being empty

匆匆过客 提交于 2019-12-11 22:42:06
问题 I'm trying to set up a redirect on a WP blog installation that will detect anyone coming in from nowhere (i.e. not from another site). The idea is to trap some of the spambots that plug pre-constructed URLs into the system to create comments/posts. I figure if they don't have a referrer site, I can pop them back to the homepage (www.domain.com/index.php or just www.domain.com), which should mess with the bots but not with real people. I understand that the referrers can be forged but

Silverstripe hash link rewriting putting unwanted slash in link

拥有回忆 提交于 2019-12-11 20:17:06
问题 Ok so I am developing a site in Silverstripe CMS that is using anchor links on one of it's pages. Thing is that in Silverstripe there is a rewrite going on that puts slashes before the hash in your links. So in the docs it explains that you can put this in your YAML to disable slashes before hashes: http://doc.silverstripe.org/en/developer_guides/templates/how_tos/disable_anchor_links/ Which I have done like so (YAML validates ok): _config/app.yml: SSViewer: rewrite_hash_links: false And then

PHP Mod rewrite for user accounts

我的未来我决定 提交于 2019-12-11 19:00:03
问题 So I've been searching for how I can rewrite a url that is like this: http://www.example.com/profile.php?username=test to something like this: http://www.example.com/user/test Also, I would like to rewrite other urls that are like this: (feed page) 'url'/profile.php?username=test&page=feed (videos page) 'url'/profile.php?username=test&page=videos to something like this: (feed page) 'url'/user/test/feed (videos page) 'url'/user/test/videos I read up on this and couldn't really find anything to