.htaccess

500 Internal Server Error is coming when i'm redirecting my normal page to AMP page htaccess error

不问归期 提交于 2020-01-11 10:33:08
问题 This is my normal page code for Redirect AMP page. <meta name="original-source" content="https://www.themobilesapp.com/<?= $abc; ?>"> <link rel="canonical" href="https://www.themobilesapp.com/<?= $abc; ?>"> <link rel="amphtml" href="https://www.themobilesapp.com/ampspecification/<?= $abc; ?>"> Normal page url is https://www.themobilesapp.com/Nokia-Lumia-638-specifications-3029 This is working fine and AMP page url is not working https://www.themobilesapp.com/ampspecification/Nokia-Lumia-638

Apache URL Re-writing not functioning properly

南笙酒味 提交于 2020-01-11 08:20:29
问题 I am trying to use apache-rewrite rule to convert the below URL: http://localhost/foo/bar/news.php?id=24 Into this format: http://localhost/foo/bar/news/foo-bar The number 24 is an id of a random row from a MySQL table, which also contains title and content fields. MariaDB [blog]> select * from articles; +----+---------+----------+ | id | title | content | +----+---------+----------+ | 1 | foo-bar | bla bla | +----+---------+----------+ 1 row in set (0.00 sec) I have the following rule inside

GET variable after mod_rewrite

夙愿已清 提交于 2020-01-11 06:50:11
问题 I have a set of product pages that obey the following htaccess rule: RewriteCond %{REQUEST_FILENAME} !-s RewriteCond %{REQUEST_URI} ^/([0-9]+)\-(.+)\.html RewriteRule ^(.*)$ /product/index.php?prod=%1-%2 [L] Which rewrites them to: example.com/123-1234.html. My problem is that I can no longer pass additional $_GET variables to the page - IE: example.com/123-1234.html?coupon=something123. Is there any way to do this? 回答1: Your looking for QSA, Query String Append RewriteCond %{REQUEST_FILENAME

.htaccess redirect if ANY query string is present?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-11 06:42:09
问题 I have the following .htaccess at present. <IfModule mod_suphp.c> suPHP_ConfigPath /home/abc/php.ini </IfModule> RewriteEngine on RewriteCond $1 !^(index\.php|media|css|js|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] AuthType Basic AuthName "Está dominado!!" AuthUserFile "/home/abc/.htpasswds/public_html/passwd" require valid-user Now the thing is, I would like to, if any query string is found after a / remove that query string. So: If we have: http://www.abc.com/

I want to remove question mark & .php extension from the url using .htaccess

泪湿孤枕 提交于 2020-01-11 06:28:06
问题 I have a problem with redirect URL in .htaccess. I want to remove .php & question marks from the URL. For Example: www.example.com/test.php?id=12 to www.example.com/test/12 need like this format. I tried using this code in my .htaccess Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## don't touch /forum URIs RewriteRule ^forums/ - [L,NC] ## hide .php extension snippet # To externally redirect /dir/foo.php to /dir/foo RewriteCond %{THE_REQUEST} ^[A-Z]

RewriteRule - two parameters but last parameter is optional

久未见 提交于 2020-01-11 04:45:08
问题 I cannot rewrite to include two parameters but the last parameter is optional, so for example: http://www.mywebsite.com/friends/jamie - (the forward slash should be optional too). Which should be the same as this: http://www.mywebsite.com/friends.php?name=jamie When including a second parameter http://www.mywebsite.com/friends/jamie/30 - Should be the same as this: http://www.mywebsite.com/friends.php?name=jamie&page=30 This rule does not work: RewriteRule ^friends/(.*)/(.*)$ friends.php?name

Using .htaccess to replace backslash in URL with forward-slash

江枫思渺然 提交于 2020-01-11 04:08:05
问题 I realise that a backslash should never appear in a URL in a form other than a URL escape code, however in this case the URL's are being generated by a .NET application for generating flashbooks. I have contacted the developer of this application with a bug report. In the interim i would like to use .htaccess to rewrite the offending backslashes. This is how the URLs appear in fiddler debugging proxy. www.example.com/folder/folder/thumbs%5C1.jpg I am using Firefox and it looks as though

move_uploaded_file failed to open stream and Permission denied error

為{幸葍}努か 提交于 2020-01-11 03:13:28
问题 i'm trying to upload a file but i'm getting this following errors in my browser: Warning move_uploaded_file(public/upload/udesignwptheme138.zip) [function.move-uploaded-file]: failed to open stream: Permission denied in <b>/home/monivbr/public_html/classes/system/Util.php on line 1803 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpJtBlbi' to 'public/upload/udesignwptheme138.zip' in /home/monivbr/public_html/classes/system/Util.php on line 1803 this is my

In .htaccess, redirect all domains except one

谁说胖子不能爱 提交于 2020-01-10 23:01:34
问题 I have multiple domains on my server. I want to redirect all of them to one (example.net). My .htaccess: RewriteEngine on RewriteRule ^(.*)$ http://www.example.net/$1 [R=301,L] I’m redirecting all URLs on my server to one main domain, but that domain is also redirecting to itself. So www.example.net returns 301 Moved Permanently and redirects back to itself. I’m told that this isn’t good for SEO. How could I fix this? 回答1: You need to add a Rewritecond to prevent it from redirecting when you

Moving Codeigniter Project to Amazon EC2, htaccess and ModRewrite Problems

╄→гoц情女王★ 提交于 2020-01-10 20:04:11
问题 I am attempting to move my Codeigniter projects from a shared hosting service to Amazon EC2 and am running into some challenges with my .htaccess settings. These settings enabled me to not have to include index.php in the url. My previous .htaccess is shown below and worked as expected with my previous hosting provider: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /simple.com/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]