logo
down
shadow

my htaccess does not affect the url


my htaccess does not affect the url

By : Durgesh S
Date : November 22 2020, 10:48 AM
I think the issue was by ths following , , Add these right below RewriteEngine On
code :
RewriteCond %{THE_REQUEST} \ /+login\.php\?task=([^&\ ]+)
RewriteRule ^ /login/%1/? [L,R]

RewriteCond %{THE_REQUEST} \ /+login\.php($|\ )
RewriteRule ^ /log-in/ [L,R]
<base href="/" />


Share : facebook icon twitter icon
htaccess RewriteCond, will it affect all the rules below it?

htaccess RewriteCond, will it affect all the rules below it?


By : Serhiy Bilorys
Date : March 29 2020, 07:55 AM
will help you
Will the RewriteCond affect only the first rule below it, or will it affect the last 2 also?
code :
RewriteCond %{HTTP_USER_AGENT} !^irefox+
RewriteRule ^tag/(.*)/$ /index.php?tag=$1
RewriteRule ^action/(.*)$ /index.php?action=$1 [L]
Remove www but do not affect subdomain (htaccess)

Remove www but do not affect subdomain (htaccess)


By : Udhayan G
Date : March 29 2020, 07:55 AM
wish of those help With (blog\.)? at the begin blog. becomes optional and so it will redirect only if it is different from blog.mysite.com and mysite.com.
code :
RewriteCond %{HTTP_HOST} !^(blog\.)?mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^mysite\.com$ [NC]
RewriteCond %{HTTP_HOST} !^blog\.mysite\.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
htaccess and folders does it affect?

htaccess and folders does it affect?


By : OrionRed
Date : March 29 2020, 07:55 AM
seems to work fine You can't have stuff like this: http://www.%{HTTP_HOST}/ in your rule's regex. The string that the regex matches against doesn't include the protocol/domain name, just the URI, so just the /cakedetails part.
Problem with that is you don't want to blindly match everything, so you need some conditions to make sure someone's not requesting an existing file.
code :
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ /cakes.php?id=$1 [L,QSA]
.htaccess affect other file url

.htaccess affect other file url


By : Aditya
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I am trying to make .htaccess rule not affect other file url , Try :
code :
RewriteEngine On
#--exclude real directories
RewriteCond %{REQUEST_FILENAME} !-d
#--and files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /tr/hp.php?q=$1 [L]
htaccess is inactive doesn't affect url anyway

htaccess is inactive doesn't affect url anyway


By : Matias
Date : March 29 2020, 07:55 AM
Does that help I have website name "www.hamargoth.com" I want to rewrite the URL because it blog based website and normal URL with Id doesn't look good and doesn't support SEO. I tried the sing htaccess file but it is not working. So please help if anyone can. To understand current URL please check website www.hamargoth.com , You can use this in your htaccess :
code :
RewriteEngine on

# redirect /Postdetail.php?pid=123 to /Post/123
RewriteCond %{THE_REQUEST} /Postdetail.php\?pid=(.+)\s [NC]
RewriteRule ^.+$ /Post/%1? [L,R]
#since /Post/123 doesn't exist we will rewrite the new uri to its original location
#rewrite /Post/123 to /Postdetail.php?pid=123
RewriteRule ^Post/(.+)/?$ /Postdetail.php?pid=$1 [L,NC]
Related Posts Related Posts :
  • https with url rewriting
  • Trying to get Websockify/noVNC to work through a reverse proxy
  • .htaccess rewrite parameters not passing to target page
  • Trying to apply mod rewrite rule for e.g. css/style.123456.css -> css/style.min.css
  • Joomla 301 redirect in .htaccess returns 404 error
  • Pass ID to another URL
  • apache2 external disk permissions
  • apache mod_rewrite user URLs to index.php
  • Redirect from subfolder to main domain with different port
  • Which ErrorDocument request will take precedence?
  • How make apache redirect the user to some page when the requested page is not existing
  • warn NameVirtualHost *:443 has no VirtualHosts
  • Remove specific slug in with htaccess
  • Relatively where does solr.data.dir in solrconfig.xml points to?
  • Redirecting HTTP to HTTPS correctly in Question2Answer script
  • Why are these mod_rewrite rules not working?
  • htaccess mod_rewrite: Simplifying URL
  • .htaccess Adding a trailing slash to requested files
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org