.htaccess

Use ajax/json in yii framework

梦想与她 提交于 2020-01-06 19:27:44
问题 Im trying to make a webshop in Yii framework. Now i want to unset a session when a user clicks on a icon. I currently have it working that is sends a json call to a file, but the url in the json call is being rewrited by my htaccess i think. JSON call: $(document).ready(function(){ $('.glyphicon-trash').click(function(){ $.getJSON("ajax/load.php?action=unset&element="+$(this).parent(), function(data) { alert(data.message); }); }); }); Error i get: GET http://mydomain.nl/my/path/to/site/ajax

Match last occurence of 4 digits htaccess rewrite

只谈情不闲聊 提交于 2020-01-06 19:23:31
问题 I'm wondering what sort of regex I could use to match the last occurence of a set of 4 digits in my url. My url is being formatted like this /ARTIST/ALBUM-4 DIGITS-EXTRA STUFF In the url, "4 DIGITS" will be the last possible occurence of 4 digits together. The thing is the ALBUM may contain sets of 4 digits, so it needs to match the last occurrence in the url. Basically I need my rewrite rule to act as follows RewriteRule ^(.*)/(.*)-(.* MATCH LAST OCCURENCE OF 4 DIGITS)-(.*)?$ album.php

.htaccess redirect .html to non .html not working

人盡茶涼 提交于 2020-01-06 18:40:24
问题 using this in my .htaccess: RewriteCond %{THE_REQUEST} \.html RewriteRule ^(.*)\.html$ /$1 [R=301,L] But the site is displaying a 404 Not Found, even though I have the file. The file is ishared.html. The redirect works, but it takes to a not found, if you go to http://headupshouldersback.com/ishared.html Any tips? Thanks! EDIT: The following gave me 500 server error on my site: RewriteCond %{THE_REQUEST} \.html RewriteRule ^(.*)\.html$ /$1 [R=301,L] RewriteRule ^(.*) /$1.html [QSA,L] 回答1:

Mod_rewrite and URL redirection - APACHE,Mod_rewrite,PHP,Codeigniter

拈花ヽ惹草 提交于 2020-01-06 17:48:07
问题 I have got a very specific problem. I am using wamp server to run my codeigniter projects locally. I have loaded mod_rewrite in and it is showing in my phpinfo. In my wamp root directory, I have a codeigniter project folder "mysite".Here is the directory structure of mysite. -mysite |--images |--eshots |--useruploads |--temp |--SpryAssets |--css |--js |--timthumb After enabling this mod_rewrite, I modified my "host" file in my windows directory and added this line of code in my virtual host

Mod_rewrite and URL redirection - APACHE,Mod_rewrite,PHP,Codeigniter

你。 提交于 2020-01-06 17:46:27
问题 I have got a very specific problem. I am using wamp server to run my codeigniter projects locally. I have loaded mod_rewrite in and it is showing in my phpinfo. In my wamp root directory, I have a codeigniter project folder "mysite".Here is the directory structure of mysite. -mysite |--images |--eshots |--useruploads |--temp |--SpryAssets |--css |--js |--timthumb After enabling this mod_rewrite, I modified my "host" file in my windows directory and added this line of code in my virtual host

Disable a file execution inside a folder .htaccess rule

☆樱花仙子☆ 提交于 2020-01-06 15:41:27
问题 I have a site where I want to disable certain extensions of file execution just for that folder. EG: www.yoursite.com/cache/test.php should not be executed. I tried this code : <FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|zip|exe|pl|jsp|asp|htm|sh|cgi|py|php)$"> Order Allow,Deny Deny from all </FilesMatch> But this stopped my sites functionality. I just want this rule to be applied inside cache folder but I can not place the .htaccess file inside because this folder is regularly

rewrite https and www

≡放荡痞女 提交于 2020-01-06 15:25:34
问题 now I have a website https. http://www.example.com -> https://www.example.com = OK ! But, I have a problem with www ://example.com -> s://example.com = not good I would like to have this redirection below : ://example.com -> s://www.example.com How with RewriteCond and RewriteRule ? Help me plz ! Thanks ! 回答1: To enforce https on all requests and redirect to www .example.com # force https and www RewriteCond %{HTTPS} off RewriteRule ^ https://www.example.com%{REQUEST_URI} [R,L] # if already

After modifying my .htaccess file to hide the .php extension from the URL, some directory items are unable to be found

爱⌒轻易说出口 提交于 2020-01-06 15:06:41
问题 Recently, I got some help modifying my .htaccess file to hide the .php extension in the url. After I got it working, a few bugs occurred with my site. For whatever reason, any php page in a sub directory returns a 404 error. For example: mywebsite.com/test/test.php (this 404's) but mywebsite.com/test/test.html (this works just fine) Since this only started occurring after my .htaccess file was modified, I am assuming the problem lies there. The file contains as follows: RewriteEngine On #

using .htaccess redirect specific URL

删除回忆录丶 提交于 2020-01-06 14:01:10
问题 how to redirect the website like this : www.old.com/test.php -> www.new.com/test.php but enter other links to www.new.com/ www.new.com/test1.php -> www.old.com/test1.php www.new.com/test2.php -> www.old.com/test2.php www.new.com/test3.php -> www.old.com/test3.php How about if the file names are not in sequence, like this: www.new.com/home.php -> www.old.com/aiej.php www.new.com/contactus.php -> www.old.com/contact.php www.new.com/aboutus.php -> www.old.com/aboutus.php www.new.com/msdv.php ->

using .htaccess redirect specific URL

妖精的绣舞 提交于 2020-01-06 14:00:13
问题 how to redirect the website like this : www.old.com/test.php -> www.new.com/test.php but enter other links to www.new.com/ www.new.com/test1.php -> www.old.com/test1.php www.new.com/test2.php -> www.old.com/test2.php www.new.com/test3.php -> www.old.com/test3.php How about if the file names are not in sequence, like this: www.new.com/home.php -> www.old.com/aiej.php www.new.com/contactus.php -> www.old.com/contact.php www.new.com/aboutus.php -> www.old.com/aboutus.php www.new.com/msdv.php ->