where to set gwt(Google webmater tool) verification in cakephp - apache

//here is my htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^glamestates\.co\.uk$ [NC]
RewriteRule ^.*$ http://www.glamestates.co.uk%{REQUEST_URI} [R=301,L] # <-- Mind the 'L'!
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
where about to add this google webmaster tools link in my htaccess
glamestates.co.uk/googlec7feca3a4513beef.html
what I have got so far but this doesn't work. I added in line five
RewriteRule ^glamestates\.co\.uk\googlec7feca3a4513beef\.html$ http://www.glamestates.co.uk\googlec7feca3a4513beef.html%{REQUEST_URI} [R=301,L]
I have already put this question here since many day nobody answered

Still not 100% clear about what you're asking, but I think perhaps you want this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^glamestates\.co\.uk$ [NC]
RewriteRule ^googlec7feca3a4513beef\.html$ $0 [L]
RewriteRule ^.*$ http://www.glamestates.co.uk%{REQUEST_URI} [R=301,L] # <-- Mind the 'L'!
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

just need to paste the googlec7feca3a4513beef.html file into Webroot folder rather than Root

Related

Having trouble with godaddy htaccess file

RewriteEngine On
RewriteBase /
RewriteRule ^/?$ /1 [L]
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^sayfa-([0-9a-zA-Z-_]+) menu-detay.php?sef=$1 [L,QSA]
RewriteRule ^kategori-([0-9a-zA-Z-_]+) kategoriler.php?sef=$1 [L,QSA]
RewriteRule ^urun-([0-9a-zA-Z-_]+)-([0-9]+)$ urun-detay.php?sef=$1&urun_id=$2 [L,QSA]
RewriteRule ^urun-([0-9a-zA-Z-_]+) urun-detay.php?sef=$1 [L,QSA]
RewriteRule ^bize-ulasin$ iletisim.php [NC,L]
RewriteRule ^sitemap.xml$ sitemap.php [NC,L]
</IfModule>
This is my htaccess file and seo links are not working. Im using LINUX hosting and couldnt find anything helpfull.
When i click my seo url on my index like "website.com/product-33v-new-generation" it redirect me to homepage.
RewriteRule ^urun-([0-9a-zA-Z-_]+)-([0-9]+)$ urun-detay.php?sef=$1&urun_id=$2 [L,QSA]
This is my seo url link for products
RewriteRule ^kategori-([0-9a-zA-Z-_]+) kategoriler.php?sef=$1 [L,QSA]
And this one is for categories.
But non of them are working for somehow. I have another linux hosting but they are working just fine.
Any help appericiated.
With your shown samples, please try following htaccess Rules. Please make sure to clear your browser cache before testing your URLs.
RewriteEngine On
RewriteBase /
RewriteRule ^/?$ index.php [L]
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
##RewriteRule ^(.*)/?$ index.php [L]
RewriteRule ^ index.php [L]
RewriteRule ^sayfa-([0-9a-zA-Z-_]+) menu-detay.php?sef=$1 [NC,L,QSA]
RewriteRule ^kategori-([0-9a-zA-Z-_]+) kategoriler.php?sef=$1 [NC,L,QSA]
RewriteRule ^urun-([0-9a-zA-Z-_]+)-([0-9]+)$ urun-detay.php?sef=$1&urun_id=$2 [NC,L,QSA]
RewriteRule ^urun-([0-9a-zA-Z-_]+) urun-detay.php?sef=$1 [L,QSA]
RewriteRule ^bize-ulasin/?$ iletisim.php [NC,L]
RewriteRule ^sitemap\.xml/?$ sitemap.php [NC,L]
</IfModule>
Few fixes in OP's tried htaccess Rules file:
You need NOT to use multiple <IfModule mod_rewrite.c> sections as per your shown attempts.
Need not to use multiple RewriteBase, you could mention it in starting of Rules.
Also fixed few Rules flags and regex in few of the other rules here.

How to redirect link with question mark

I need to redirect:
https://www.example.com/wiki/?t=1234 to https://www.example.com/vb/showthread.php?t=1234
"1234" is hundreds of pages with different numbers
I try in .htaccess but doesn't seem to work:
RewriteCond %{QUERY_STRING} t=[0-9]
RewriteRule ^(.*)$ /vb/showthread.php?t=$1 [L]
The number may occur once or more in query string ([0-9]+)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^wiki\/
RewriteCond %{QUERY_STRING} t=([0-9]+) [NC]
RewriteRule (.*) /vb/showthread.php?t=$1 [L]
</IfModule>

htaccess rewrite for only root domain, selected files and selected folders

Been fidling with it my self but I think I am doing it all wrong, please advice:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !\-f
RewriteRule ^folder1(.*)$ https://newdomain.com$1 [L,R=301]
RewriteRule ^folder2(.*)$ https://newdomain.com/$1 [L,R=301]
RewriteRule ^folder3(.*)$ https://newdomain.com/somefolder/$1 [L,R=301]
RewriteRule ^page1\.html https://newdomain.com/$1 [L,R=301]
RewriteRule ^page2\.html https://newdomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^/?$ https://newdomain.com/ [L,R=301]
</IfModule>
If I request a page/folder for olddomain.com which is not in .htaccess it should not rewrite.
Does anyone have more skills in .htaccess than me?
Thanks,
Marc
Probably you should prepend an additional condition among the ones about newdomain
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com$ [NC]

.htaccess redirect for all files but with exceptions

I know this has been asked thousands times, but I've been googling for three hours without any result. So I'm asking here. I'm creating a website. All the content is in the folder /subfolder. Now I want to redirect all the requests to another domain (let's say domain.com), at the exception of the files that I actually use. It may seem weird but it makes sense in my situation. So what I have at the moment is
RewriteEngine on
RewriteRule ^account$ account.php
RewriteRule ^home$ myhome.php
RewriteRule ^options$ options.php
RewriteRule ^login$ login.php
RewriteRule ^links$ editlinks.php
RewriteRule ^help$ howto.php
RewriteRule ^$ index.php
RewriteRule ^forgot$ forgot.php
RewriteRule ^r$ redirect.php
RewriteRule ^r/(.*)$ redirect.php?id=$1
RewriteCond %{REQUEST_URI} !(login.php|login)
RewriteRule (.*) external.php?parameter=$1 [L]
How can I do this ? the above code always redirects me to domain.com.
Thank you in advance
Make sure to place redirect just below RewriteEngine On and use THE_REQUEST instead of REQUEST_URI like this:
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{THE_REQUEST} !/media [NC]
RewriteCond %{THE_REQUEST} !/(login|signup)(\.php)?[?\s] [NC]
RewriteRule (.*) http://domain.com/$1 [R=301,L]
RewriteRule ^home$ myhome.php [L]
RewriteRule ^links$ editlinks.php [L]
RewriteRule ^help$ howto.php [L]
RewriteRule ^(account|login|options|forgot)/?$ $1.php [L,NC]
RewriteRule ^r$ redirect.php [L]
RewriteRule ^r/(.+)$ redirect.php?id=$1 [L,QSA]

REPOST: htaccess Error and Optimization

Can anybody help me optimize and fix my .htaccess file? I'm really bad at regex and I'm not a server person and site I'm building is inaccessible because of the error. Any help would be very much appreciated.
SetEnv _SRVR_ENV beta
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
## Paypal Callback Rules
RewriteCond %{QUERY_STRING} token=(\w+-\w+)&PayerID=(\w+)
RewriteRule ^some-seo-text-(\w+)-(\w+)\.html /index.php?c=$1&m=$2&token=%1&payerid=%2 [L]
RewriteCond %{QUERY_STRING} token=(\w+-\w+)
RewriteRule ^some-seo-text-(\w+)-(\w+)-(\w+)\.html /index.php?c=$1&m=$2&token=%3 [L]
RewriteCond %{QUERY_STRING} token=(\w+-\w+)
RewriteRule ^some-seo-text-(\w+)-(\w+)\.html /index.php?c=$1&m=$2&token=%1 [L]
RewriteCond %{QUERY_STRING} session=(.*)
RewriteRule ^some-seo-text-(\w+)-(\w+)\.html /index.php?c=$1&m=$2&session=%1 [L]
## Custom Rules
RewriteRule ^some-seo-text-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /index.php?c=$1&m=$2&v1=$4&v2=$6&v3=$8 [L]
RewriteRule ^some-seo-text-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.html$ /index.php?c=$1&m=$2&v1=$4&v2=$6 [L]
RewriteRule ^some-seo-text-(.*)-(.*)-(.*)-(.*)\.html$ /index.php?c=$1&m=$2&v1=$4 [L]
RewriteRule ^some-seo-text-(.*)-(.*)\.html$ /index.php?c=$1&m=$2 [L]
RewriteRule ^some-seo-text-(.*)-(.*)\.html$ /index.php?c=$1&m=$2 [L]
RewriteRule ^some-seo-text-(.*)\.html$ /index.php?c=$1 [L]
## Directory Cloaking
RewriteRule ^images/another-seo-text-(.*)$ /static/images/$1 [L]
RewriteRule ^deals/another-seo-text-(.*)$ /static/images/campaigns/$1 [L]
RewriteRule ^css/(.*)$ /static/stylesheets/$1 [L]
RewriteRule ^js/(.*)$ /static/javascripts/$1 [L]
RewriteRule ^captcha/(.*)$ /static/captcha/$1 [L]
Note that (.*) will happily match a - in an URL, making many of these matches ambiguous, and perhaps very slow. Your \w matches probably make more sense.
Can you paste the diff(1) between your last known good working .htaccess and this one? That would help you find the fault quickly.