mod-rewrite

change to https and redirect to subfolder rule in .htaccess

[亡魂溺海] 提交于 2019-12-12 02:53:10
问题 I am trying to do two things here: redirect to a sub-folder redirect http://www.something.com/some/page.html or https://www.something.com/some/page.html to https://www.something.com/subfolder/some/page.html redirect http to https redirect http://www.something.com/subfolder/some/page.html to https://www.something.com/subfolder/some/page.html And I want to do both of them in the same .htaccess file I have been able to redirect to subfolder by the following code: Options +FollowSymLinks

Simple mod_rewrite RewriteRule for messy legacy url's

帅比萌擦擦* 提交于 2019-12-12 02:47:01
问题 Launching a new website for a new client. Their old site has about 50 products and unfortunately, the old product names do not match up to the new URL pattern Old URL Examples: example.com/products.aspx?category=Foo&product=SuperLongNoBreakProductNameIDDescription example.com/products.aspx?category=Foo&product=ProductNameDescription&var1=1293.123 example.com/products.aspx?category=Bar&product=ProductCategoryProdNameRandomNumbers (The old URL's are sometimes hitting 150+ characters.) New URL's

Redirecting http://example.com to http:/www.example.com while keeping http://subdomain.example.com access intact

跟風遠走 提交于 2019-12-12 02:39:01
问题 I have a website on which I've enabled subdomain access such as: http://subdomain1.example.com which accesses the same code, but passing a domain parameter in order to show a different microsite. The httpd.conf code for that looks like this: RewriteCond %{HTTP_HOST} ^([^./]+)\.example\.com$ RewriteRule forums.html$ /browse.php?type=forums&domain=%1 [QSA] Now I need to redirect http://example.com to http://www.example.com I tried this, but it did not work: RewriteCond %{HTTP_HOST} ^example\

allow slash in url .htaccess

◇◆丶佛笑我妖孽 提交于 2019-12-12 02:37:23
问题 I have a webpage set up where the user can navigate to a certain item on the page like so: www.example.com/models.php#DDD-34 At the moment it uses a # symbol to indicate the code of the item i want to link to. Would it be possible using .htaccess to allow a / symbol instead of the # So instead of the above to link to a item its www.example.com/models.php/DDD-34 Would this be possible in anyway? Because / means a path it brings sup a 404 error. what .htaccess code would allow this? 回答1: There

.htaccess rewriting rule rewriting css files

笑着哭i 提交于 2019-12-12 02:27:40
问题 I have a rewrite rule to make pretty url but its rewriting css, js and other files too. I want to rewrite http://localhost/example/post/?postid=af1ub4zu4y&title=this-is-the-first-post.html to http://localhost/example/post/af1ub4zu4y/this-is-the-first-post.html I am trying this way Options +FollowSymlinks -MultiViews RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^post/([^/]*)/(.*\.html) /example/post/?postid=$1&title=$2 [QSA

url construction htaccess

扶醉桌前 提交于 2019-12-12 02:17:53
问题 Lets say I have a link to one of my page that looks like: mysite.com/48YSWD96, I need it to look like: mysite.com/?d=48YSWD96. How do I achieve this? Can I achieve this by modifying my htaccess file? which currently looks like this... RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI

codeigniter htaccess file in subdomain

廉价感情. 提交于 2019-12-12 02:11:37
问题 I did a project in codeigniter. It worked perfect in localhost. The htaccess file in localhost: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule> Then i removed the project to hosting to subdomain college.utest.kz But it did not work on the internet. Changed the htaccess file content as in codeigniter documentation.

How to Redirect static urls to small urls

别等时光非礼了梦想. 提交于 2019-12-12 02:07:42
问题 I recently changed my site url structure. But, Google indexed urls are giving 404 not found errors. Now, I asked for help and got suggestion like this. RewriteRule ^([a-z|-]+)t(\d{3}-\d+\.html)$ /topic$2 [NC,R=301,L] But, for that, I'm getting firefox error: "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." My previous code is like this: # FORUMS PAGES ############### # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum

.htaccess not working on live site but working on localhost?

人走茶凉 提交于 2019-12-12 02:03:10
问题 I am using ExpressionEngine and want to remove index.php from my URL's. I have this .htaccess file saved in the root folder. It works perfectly on localhost but when I upload it to the server it doesn't work. The correct URL appears in the address bar but the page stays on homepage. Any tips? <IfModule mod_rewrite.c> # Enable Rewrite Engine # ------------------------------ RewriteEngine On RewriteBase / # Redirect index.php Requests # ------------------------------ RewriteCond %{THE_REQUEST}

Removing index.php in codeigniter -htaccess

假装没事ソ 提交于 2019-12-12 02:00:04
问题 Im trying to remove index.php from the url for the past 4 days but not successful. http://domainName.com/CI/index.php/controller-name/function/parameter CI is the folder hosted in godaddy. / .htaccess CI After googling, I tried with the following codes but getting only a blank page or error:500 and also I didn't understand the logic. Please someone help me to find where Im going wrong. RewriteEngine on RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)