asgsoft VIP Member VIP ★ 20 ★ Impact 9 Oct 8, 2006 707 views 5 replies #1 How can I redirect all the hits from seotools.php to mysite.com/seo-tools/ when the folder doesn't exist? I know it can be done , .htaccess but how?
How can I redirect all the hits from seotools.php to mysite.com/seo-tools/ when the folder doesn't exist? I know it can be done , .htaccess but how?
Barrucadu Established Member ★ 20 ★ Impact 64 Oct 8, 2006 #2 Not sure about the .htaccess, but as the title says "php url redirection", here is the php code: PHP: <?php header('Location: /path/to/your/file.php'); ?>
Not sure about the .htaccess, but as the title says "php url redirection", here is the php code: PHP: <?php header('Location: /path/to/your/file.php'); ?>
D DJL2K Pimp Master MEstablished Member ★ 15 ★ Impact 0 Oct 8, 2006 #3 That's jsut the PHP version of a Meta Refresh. This is what you're after I believe. Make a file called .htaccess nothing else and put this in: RewriteEngine on RewriteRule ^(.*)/ /$1.php [nc]
That's jsut the PHP version of a Meta Refresh. This is what you're after I believe. Make a file called .htaccess nothing else and put this in: RewriteEngine on RewriteRule ^(.*)/ /$1.php [nc]
asgsoft VIP Member VIP ★ 20 ★ Impact 9 Oct 8, 2006 #4 DJL2K said: That's jsut the PHP version of a Meta Refresh. This is what you're after I believe. Make a file called .htaccess nothing else and put this in: RewriteEngine on RewriteRule ^(.*)/ /$1.php [nc] Click to expand... where does it mention seo-tools and seotools.php?
DJL2K said: That's jsut the PHP version of a Meta Refresh. This is what you're after I believe. Make a file called .htaccess nothing else and put this in: RewriteEngine on RewriteRule ^(.*)/ /$1.php [nc] Click to expand... where does it mention seo-tools and seotools.php?
Dan Buy my domains.VIP Member VIP ★ 15 ★ Impact 108 Oct 8, 2006 #5 The (.*) matches anything. Code: RewriteEngine on RewriteRule ^seo-tools/? seotools.php [NC] This code does what his does but is more specific. Also, his will probably cause errors due to not being setup how your files and links are set up. My code makes it so that if someone goes to http://your-site.com/seo-tools it will actually load http://your-site.com/seotools.php
The (.*) matches anything. Code: RewriteEngine on RewriteRule ^seo-tools/? seotools.php [NC] This code does what his does but is more specific. Also, his will probably cause errors due to not being setup how your files and links are set up. My code makes it so that if someone goes to http://your-site.com/seo-tools it will actually load http://your-site.com/seotools.php